You want your URLs to be pretty and more RESTful like so:
Well, you have two options. You can re-write your web application to use newer web frameworks that supports REST-style URLs such as Spring MVC 3.0, which will probably take months to do. Or you can use UrlRewriteFilter which should take no more than 30 minutes and will work with any existing Java web application.
UrlRewriteFilter very easy to use. You basically:
- Add UrlRewriteFilter as a servlet filter in your WEB-INF/web.xml
- Populate WEB-INF/urlrewrite.xml with mappings of REST-style URLs to the corresponding URLs of your legacy web application (with query params and what not).
UrlRewriteFilter is extremely powerful. It supports regular expression pattern matching, allowing you to perform pretty complex mapping. Check out the manual page for details.