I'm trying to map a request to static resources in a spring environment. My app server is Jetty.
In web.xml, I'm mapping various url patterns to my spring servlet:
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/static/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/otherpath/*</url-pattern>
</servlet-mapping>
[many more mappings...]
Note that "/" is not mapped to my spring servlet.
In spring-servlet.xml, I'm using the mvc:resources tag to map a url to a directory with my static content:
<mvc:resources mapping="/static/**" location="/WEB-INF/static/" />
This does not work as I expected. Instead of mapping
/static/ to /WEB-INF/static/,
it maps
/static/static/ to /WEB-INF/static
The reason is that the mapping given in "mvc:resources" seems to not be relative to / but relative to the path that maps to the spring servlet.
Is there a way to consider the full path, relative to / for the mapping, not the path relative to the servlet mapping?