Is there a url rewriting engine for Tomcat/Java?

anshuman picture anshuman · Jun 4, 2009 · Viewed 22.2k times · Source

How can we provide URL-Rewriting support for Tomcat/Java ?

mod_rewrite provides this functionality for Apache and can modify URLs even before they reach the handler (e.g. PHP). Is there a similar tool in Java/Tomcat ?

To be more specific we need modifications such as

  http://www.somedomain.com/person/1
      Maps to
  http://www.somedomain.com/details?personId=1

And this should be transparent to the servlet code, i.e. we should be able to access request.getParameter("personId") in the servlet and get the personId (1 in this case).

Did you come across such a scenario ? What tool did you use ?
Would love to hear your suggestions.

Answer

Robert Munteanu picture Robert Munteanu · Jun 4, 2009