

UrlRewriteFilter

A Java Web Filter for any compliant web application servers (such as Tomcat, JBoss, Jetty or Resin), which allows you to rewrite URLs before they get to your code. It is a very powerful tool just like Apache's mod_rewrite.

Install

1 urlrewritefilter- 4.0.3 .jar

to WEB-INF/lib



Or add Maven dependency AddtoOr add Maven dependency <dependency> <groupId>org.tuckey</groupId> <artifactId>urlrewritefilter</artifactId> <version> 4.0.3 </version> </dependency>

2 WEB-INF/web.xml add (near the top above any servlet mappings): (see <filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> Toadd (near the top above any servlet mappings): (see filter parameters for more options)

3 urlrewrite.xml in WEB-INF (src/main/webapp/WEB-INF/ for Maven users)



After restarting you can visit Addin(src/main/webapp/WEB-INF/ for Maven users)After restarting you can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp and context) to see output (note: this page is only viewable from localhost).

Documentation

Support

Source