public abstract class AbstractRewriteFilter extends java.lang.Object implements RewriteFilter
Abstract filters have a URL regexp pattern which only applies the filter to matching URLs. If the regexp is missing, all URLs will match.
Any rewrite/security predicate like IfUser or IfAddress can be used to restrict requests. Only requests that match all the predicates will be filtered.
The AbstractRewriteFilter can have child RewriteFilters and child servlet Filters. The children will only be added to the filter chain if the predicates match.
<resin:SetHeader regexp="\.pdf$"
name="Cache-Control" value="max-age=15">
<resin:IfUserInRole role="admin"/>
<resin:SetHeader>
Constructor and Description |
---|
AbstractRewriteFilter() |
Modifier and Type | Method and Description |
---|---|
void |
add(Filter filter) |
void |
add(RequestPredicate predicate) |
void |
add(RewriteFilter filter) |
protected FilterChain |
createFilterChain(java.lang.String uri,
java.lang.String queryString,
FilterChain next) |
boolean |
isForward() |
boolean |
isInclude() |
boolean |
isRequest() |
FilterChain |
map(java.lang.String uri,
java.lang.String queryString,
FilterChain next)
Creates a FilterChain for the action based on the uri and query string.
|
void |
setRegexp(java.util.regex.Pattern regexp) |
java.lang.String |
toString() |
public void setRegexp(java.util.regex.Pattern regexp)
public boolean isRequest()
isRequest
in interface RewriteFilter
public boolean isInclude()
isInclude
in interface RewriteFilter
public boolean isForward()
isForward
in interface RewriteFilter
public void add(RequestPredicate predicate)
public void add(RewriteFilter filter)
public void add(Filter filter) throws ServletException
ServletException
public FilterChain map(java.lang.String uri, java.lang.String queryString, FilterChain next) throws ServletException
RewriteFilter
map
in interface RewriteFilter
uri
- the request URI to match againstqueryString
- the request query string to match againstnext
- the next rewrite FilterChain dispatchServletException
protected FilterChain createFilterChain(java.lang.String uri, java.lang.String queryString, FilterChain next)
public java.lang.String toString()
toString
in class java.lang.Object