java.net: Wiki

The Source for Java Technology Collaboration


 <<O>>  Difference Topic UrlRewriteFilter (5 - 22 Apr 2004 - Main.ptuckey)
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changes | Index | Search | Go
<-- This creates the navigation links to :  Home | Help | Index | etc.  -->
| WebNotify

Url Rewrite Filter

Changed:
<
<

Forum - Download - Manual - java.net project home

>
>

Url Rewrite Filter java.net project home

 
Added:
>
>

Forum - Manual

 
Changed:
<
<

Based on the popular and very useful mod_rewrite for apache, UrlRewriteFilter is a Java Web Filter for any J2EE? compliant web application server (such as Resin, Orion or Tomcat), which allows you to rewrite URLs before they get to your code. It is a very powerful tool just like Apache's mod_rewrite.

>
>
https://urlrewrite.dev.java.net/
 
Deleted:
<
<

Url Rewriting is very common when using the Apache Web Server (see mod_rewrite's rewriting guide) but has not been possible in most web application servers. The main things it is used for are:

  • URL Tidyness - 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.

UrlRewriteFilter uses an xml file, called urlrewrite.xml (lives in the WEB-INF directory), for configuration. Most parameters can be Perl5 style Regular Expressions. This makes it very powerful indeed.

It uses libraries from Apache Jakarta (Commons Digester and Oro).

Download & Installation

Version 1.1 latest release

  1. Download the zip/tar.gz and extract it into your WEB-INF directory.
  2. Add the following to your WEB-INF/web.xml (add it near the top above your servlet mappings (if you have any)): (see for more options)
    	 <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>
    
    	 </filter-mapping>
    
  3. Add your own configuration to the WEB-INF/urlrewrite.xml that was created.
  4. Restart the context.

You can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp) to see output (note: this page is only viewable from localhost and it outputs plain text so it's easy to use remotely from lynx or wget.

Changes

For in-depth details see CVS.

  • 4-2004 - created java.net project move to java.net wiki from old homepage - http://tuckey.org/urlrewrite/
  • 1.1 (4/2004) - Ability to disable rules, Refactored to enable rewriter to be embedded, changed logging to enable log level to be set, added name and note elements to rule for documentation, ability to disable status page, ability to change status prefix, javadoc style ant task for an HTML configuration report.
  • 1.0 (3/2004) - General tidy up of logging, tidy up of all code, dist now includes manual, log4j and junit removed from bin release.
  • 0.9 (2/2004) - Fixed conf loading problem in Resin, resolved concurrency issue with Perl5Compiler? and Perl5Matcher? (thanks Scott Askew!)
  • 0.8 (2/2004) - Removed dependency on "Commons Lang", Changed DTD path (bug fix), added ability to put time fields in "condition" element, added ability to put "operators" in the "condition" element, fixed multiple rules issue (bug fix)
  • 0.7 (11/2003) - Improved test cases, documentation
  • 0.6 (8/2003) - Improved error handling, status page and condition matching
  • 0.5 (6/2003) - Improved configuration error handling

License

UrlRewriteFilter is distributed under the BSD License. For more information on the BSD license see opensource.org/licenses.

Mentions & Related

-- Main.ptuckey - 20 Apr 2004

 
META TOPICMOVED by="ptuckey" date="1082453817" from="Javawsxml.UrlrewriteProject" to="Javawsxml.UrlRewriteFilter"

 <<O>>  Difference Topic UrlRewriteFilter (4 - 22 Apr 2004 - Main.ptuckey)
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changes | Index | Search | Go
<-- This creates the navigation links to :  Home | Help | Index | etc.  -->
| WebNotify
Line: 93 to 93
 
Changed:
<
<
  • Russell Beattie's Notebook here and [[http://www.russellbeattie.com/notebook/1007584.html][here].
>
>
  • Russell Beattie's Notebook here and here.
 

 <<O>>  Difference Topic UrlRewriteFilter (3 - 21 Apr 2004 - Main.pelegri)
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Added:
>
>
Changes | Index | Search | Go
<-- This creates the navigation links to :  Home | Help | Index | etc.  -->
| WebNotify
 

Url Rewrite Filter

Forum - Download - Manual - java.net project home


 <<O>>  Difference Topic UrlRewriteFilter (2 - 21 Apr 2004 - Main.ptuckey)
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Url Rewrite Filter

Changed:
<
<
>
>

Forum - Download - Manual - java.net project home

 

Based on the popular and very useful mod_rewrite for apache,

Line: 33 to 33
 
Changed:
<
<

Download & Installation

>
>

Download & Installation

 Version 1.1 latest release
Line: 69 to 68
 plain text so it's easy to use remotely from lynx or wget.

Changed:
<
<

Changes

>
>

Changes

For in-depth details see CVS.

 
Changed:
<
<

1.1 (4/2004) - Ability to disable rules, Refactored to enable rewriter to be embedded, changed logging to enable log level to be set, added name and note elements to rule for documentation, ability to disable status page, ability to change status prefix, javadoc style ant task for an HTML configuration report.
1.0 (3/2004) - General tidy up of logging, tidy up of all code, dist now includes manual, log4j and junit removed from bin release.


0.9 (2/2004) - Fixed conf loading problem in Resin, resolved concurrency issue with Perl5Compiler? and Perl5Matcher? (thanks Scott Askew!)
0.8 (2/2004) - Removed dependency on "Commons Lang", Changed DTD path (bug fix), added ability to put time fields in "condition" element, added ability to put "operators" in the "condition" element, fixed multiple rules issue (bug fix)
0.7 (11/2003) - Improved test cases, documentation
0.6 (8/2003) - Improved error handling, status page and condition matching
0.5 (6/2003) - Improved configuration error handling

>
>
  • 4-2004 - created java.net project move to java.net wiki from old homepage - http://tuckey.org/urlrewrite/
  • 1.1 (4/2004) - Ability to disable rules, Refactored to enable rewriter to be embedded, changed logging to enable log level to be set, added name and note elements to rule for documentation, ability to disable status page, ability to change status prefix, javadoc style ant task for an HTML configuration report.
  • 1.0 (3/2004) - General tidy up of logging, tidy up of all code, dist now includes manual, log4j and junit removed from bin release.
  • 0.9 (2/2004) - Fixed conf loading problem in Resin, resolved concurrency issue with Perl5Compiler? and Perl5Matcher? (thanks Scott Askew!)
  • 0.8 (2/2004) - Removed dependency on "Commons Lang", Changed DTD path (bug fix), added ability to put time fields in "condition" element, added ability to put "operators" in the "condition" element, fixed multiple rules issue (bug fix)
  • 0.7 (11/2003) - Improved test cases, documentation
  • 0.6 (8/2003) - Improved error handling, status page and condition matching
  • 0.5 (6/2003) - Improved configuration error handling
 
Changed:
<
<

License

>
>

License

 

UrlRewriteFilter is distributed under the BSD License. For more information on the BSD license see opensource.org/licenses.

Mentions & Related

Changed:
<
<
>
>
 

 <<O>>  Difference Topic UrlRewriteFilter (1 - 20 Apr 2004 - Main.ptuckey)
Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Url Rewrite Filter

Based on the popular and very useful mod_rewrite for apache, UrlRewriteFilter is a Java Web Filter for any J2EE? compliant web application server (such as Resin, Orion or Tomcat), which allows you to rewrite URLs before they get to your code. It is a very powerful tool just like Apache's mod_rewrite.

Url Rewriting is very common when using the Apache Web Server (see mod_rewrite's rewriting guide) but has not been possible in most web application servers. The main things it is used for are:

  • URL Tidyness - 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.

UrlRewriteFilter uses an xml file, called urlrewrite.xml (lives in the WEB-INF directory), for configuration. Most parameters can be Perl5 style Regular Expressions. This makes it very powerful indeed.

It uses libraries from Apache Jakarta (Commons Digester and Oro).

Download & Installation

Version 1.1 latest release

  1. Download the zip/tar.gz and extract it into your WEB-INF directory.
  2. Add the following to your WEB-INF/web.xml (add it near the top above your servlet mappings (if you have any)): (see for more options)
    	 <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>
    
    	 </filter-mapping>
    
  3. Add your own configuration to the WEB-INF/urlrewrite.xml that was created.
  4. Restart the context.

You can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp) to see output (note: this page is only viewable from localhost and it outputs plain text so it's easy to use remotely from lynx or wget.

Changes

1.1 (4/2004) - Ability to disable rules, Refactored to enable rewriter to be embedded, changed logging to enable log level to be set, added name and note elements to rule for documentation, ability to disable status page, ability to change status prefix, javadoc style ant task for an HTML configuration report.
1.0 (3/2004) - General tidy up of logging, tidy up of all code, dist now includes manual, log4j and junit removed from bin release.


0.9 (2/2004) - Fixed conf loading problem in Resin, resolved concurrency issue with Perl5Compiler? and Perl5Matcher? (thanks Scott Askew!)
0.8 (2/2004) - Removed dependency on "Commons Lang", Changed DTD path (bug fix), added ability to put time fields in "condition" element, added ability to put "operators" in the "condition" element, fixed multiple rules issue (bug fix)
0.7 (11/2003) - Improved test cases, documentation
0.6 (8/2003) - Improved error handling, status page and condition matching
0.5 (6/2003) - Improved configuration error handling

License

UrlRewriteFilter is distributed under the BSD License. For more information on the BSD license see opensource.org/licenses.

Mentions & Related

-- Main.ptuckey - 20 Apr 2004

META TOPICMOVED by="ptuckey" date="1082453817" from="Javawsxml.UrlrewriteProject" to="Javawsxml.UrlRewriteFilter"

Topic UrlRewriteFilter . { View | Diffs r5 < r4 < r3 < r2 | More }
 XML java.net RSS