If I listed my spring application for processing all incoming requests ('/ *'), then requests for static content return 404. For example, the query โmyhost.com/css/global.cssโ will return 404, although the resource exists as spring intercepts the request .
An alternative is to map SpringMVC to a subdirectory (e.g. '/ home /'), but in this case you must pass this directory to all the links in the application. Is there a way to map SpringMVC to '/' and exclude a set of directories from processing?
My current web.xml configuration is:
<servlet> <servlet-name>springApp</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springApp</servlet-name> <url-pattern>/home/*</url-pattern> </servlet-mapping>
Idealism I would like the display to be something like this:
<servlet-mapping> <servlet-name>springApp</servlet-name> <url-pattern>/*</url-pattern> <exclude>/css/*,/js/*</exclude> </servlet-mapping>
Is it possible?
spring spring-mvc configuration
Rich Kroll Aug 05 '09 at 16:24 2009-08-05 16:24
source share