com.isomorphic.servlet
Class URIRegexFilter

java.lang.Object
  |
  +--com.isomorphic.servlet.BaseFilter
        |
        +--com.isomorphic.servlet.URIRegexFilter
All Implemented Interfaces:
javax.servlet.Filter

public class URIRegexFilter
extends com.isomorphic.servlet.BaseFilter

Most servlet containers do not allow filter registration based on Regex rules. This filter rectifies the problem. To use, register the filter to intercept /* or whatever slice of the URI space you want and provide a rules file either in web.xml (see the doc for the rules init-param) or in a seprate file referenced in web.xml via the rulesFile init-param.

Rules take the following form: :

Where is one of: block, ignore, match and the regular expression is one that is acceptable to the Jakarta ORO Perl5Util class, inside delimiters of your choosing. The following are valid regular exprssions: /foo/ |foo| #foo#. Rules are evaluated in the order they appear, and the first match wins. If no rules match, the outcome is determined by the value of defaultAction. Once the action is determined, one of the following methods is called: