I have a spring app with one servlet that has url-mapping of *.html. Everything is working great with my annotated controllers.
My question is how can I setup my servlet and annotated mappings to mimic the urls like StackOverflow?
I would like to go to a no extension url and if possible add a description after the final /.
Example:
I currently have:
/appName/parm1/parm2/pageName.html
I would like to have
/appName/parm1/parm2/pageName/description
Is this possible and what do I need to do to my annotated controllers?
Thanks
You should be able to map the dispatcher servlet to /* or something like that, and then use @PathVariables to get the needed information from the URI. Have a look at http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html and search for @PathVariable. Here’s an example from that page
which reads the ownerId and the petId from the request uri.