Announcement Announcement Module
No announcement yet.
Problem with URL resolution in action-servlet.xml Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.:


    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,

  • #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.