Announcement Announcement Module
No announcement yet.
Weird problem with url-pattern and MVC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Weird problem with url-pattern and MVC

    I have a web application I haven't touched for a couple of years which uses annotation driven controllers. In the original all the requests end in .htm and the url-pattern in web.xml for the dispatcher is *.htm.

    I now to need to add a couple of RESTful services to the application. All seemed pretty straight forward, except for the need for a special authentication mechanism. I added a url-pattern of /services/* to the dispatcher Servlet (in web.xml), which I've seen used in many projects and a controller with @RequestMapping(value="/services/invoice"...), confidently expecting Spring to invoke the method.

    url-pattern /services/* -> Error 404.

    url-pattern /services/invoice -> works fine.

    Oh, we're talking Tomcat 7, by the way

    url-pattern /* -> service works fine, but obviously the fixed files won't

    Looks like if the service calls go into the dispatcher, they work. Now I need to add a new service with a variable url /services/verifySupplier/{supplierCode}.

    What can possibly be wrong with /services/* ?
    Last edited by soupdragon; Feb 8th, 2013, 03:16 AM. Reason: Forgot to mention server