-
Oct 30th, 2005, 09:01 AM
#1
Problem with URL resolution in action-servlet.xml
Hi there,
I need a hint:
in my action-servlet.xml I have a SimpleUrlHandlerMapping which maps a subclass of AbstractController to /foo/* and /foo/**/*, the controller then parses the path and returns the appropriate ModelAndView. Now the problem is, this only works for files which are mapped in web.xml to the action servlet, e.g.:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
Is there a way to map requests to *everything* that matches /foo/* and /foo/**/*, i.e. not only .html files, but also directories like /foo/bar/ and files with other endings? I mean sure, I could just have a <url-pattern>*</url-patter> which would probably solve the issue. However this would mean, that everything served by my servlet container (tomcat5) would have to pass through the servlet engine, even static files like CSS, images and javascript files. Right?
Any hints are greatly appreciated!
Thanks in advance,
jenner
-
Oct 30th, 2005, 10:15 AM
#2
You need to map * in the web.xml for all requests to be even passed to Spring. By mapping just *.html to the Spring servlet, the servlet container will not even pass requests that don't in .html to Spring.
Rob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules