How can I serve static content from CXF / JAX-RS with my rest API mapped to root context?
问题 I have a rest API using CXF to implement JAX-RS where the REST endpoints are directly on the root context. For example if my root context is localhost:8080/myservice And my endpoints are: localhost:8080/myservice/resource1 localhost:8080/myservice/resource2 But I want to serve static content like this: localhost:8080/myservice/docs/swagger.json In my web.xml I'd like to do something like this: <servlet-mapping> <servlet-name>CXFServlet</servlet-name> <url-pattern>/*</url-pattern> </servlet