Rewrite URL in Java

Do you line nice URLs? Let’s say example.com/hello/ instead of example.com/hello.jsp ? The first one is without doubts better, does not reveal underneaths technology, and you are free to change it to another technology in the future without changing URLs. Well, there is URLRewriteFilter for J2EE compliant application. It is based on mod_rewrite for Apache, and available at http://www.tuckey.org/urlrewrite/ . Latest version is 3.0.2 and jar file urlrewrite-3.2.0.jar should be copied into lib directory, like {glassfish}/lib or {apache-tomcat}/lib .  Into application/WEB-INF subdirectory should be placed file urlrewrite.xml (next to web.xml).

This entry was posted in workday. Bookmark the permalink.

Leave a Reply