Url Rewrite
is a simple filter that adds an extremely versatile url rewrite function to web-based applications.
What is it?
A filter that sits in front of the servlet framework. it is configured by an XML file that enables URL's to be munged and rewritten on the fly, similar to Apache mod_rewrite.
Why use it?
Rewriting url's is a great way to provide a simple url to the client which is rewritten for the backend.
Example:
http://server.foo.com/details/tcolson
--> http://server.foo.com/directory/showdetails.do?uid=tcolson![]()
More uses (from URL Rewrite site)
- URL Tidyness / URL Abstraction
- keep URLs tidy irrespective of the underlying technology or framework (JSP, Servlet, Struts etc). - Browser Detection - Allows you to rewrite URLs based on request HTTP headers (such as user-agent or charset).
- Date based rewriting - Allows you to forward or redirect to other URL's based on the date/time (good for planned outages).
- Moved content - enable a graceful move of content or even a change in CMS.
- Tiny/Friendly URL's (i.e. blah.com/latest can be redirected to blah.com/download/ver1.2.46.2/setup.exe)
- A Servlet mapping engine (see Method Invocation)