Monday, March 7, 2011

Mapping 2 or more URL patterns with same servlet

We have a simple Spring MVC servlet (as usual), nothing out of normal.
With its respective mapping
This is the tricky part, I want to map some weird request mappings like: *.htm or *.jspx (besides *.do)
  • registerCustomer.do
  • registerCustomer.htm
  • registerCustomer.jspx

The solution is simple, just add another entry to your servlet-mapping: The only restriction is to use web-app version=2.4 or 2.5
I always use 2.4 and I didn't have anything else to do. But for educational purposes I updated my web.xml (web app descriptor) for my future developments.

No comments:

Post a Comment