|
Apache Tomcat 7.0.22 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.filters.FilterBase
org.apache.catalina.filters.RequestFilter
public abstract class RequestFilter
Implementation of a Filter that performs filtering based on comparing the appropriate request property (selected based on which subclass you choose to configure into your Container's pipeline) against the regular expressions configured for this Filter.
This filter is configured by setting the allow
and/or
deny
properties to a regular expressions (in the syntax
supported by Pattern
) to which the appropriate request property will
be compared. Evaluation proceeds as follows:
process()
method.
Field Summary | |
---|---|
protected java.util.regex.Pattern |
allow
The regular expression used to test for allowed requests. |
protected java.util.regex.Pattern |
deny
The regular expression used to test for denied requests. |
Fields inherited from class org.apache.catalina.filters.FilterBase |
---|
sm |
Constructor Summary | |
---|---|
RequestFilter()
|
Method Summary | |
---|---|
abstract void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
Extract the desired request property, and pass it (along with the specified request and response objects) to the protected process() method to perform the actual filtering. |
java.lang.String |
getAllow()
Return the regular expression used to test for allowed requests for this Filter, if any; otherwise, return null . |
java.lang.String |
getDeny()
Return the regular expression used to test for denied requests for this Filter, if any; otherwise, return null . |
protected void |
process(java.lang.String property,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Perform the filtering that has been configured for this Filter, matching against the specified request property. |
protected void |
processCometEvent(java.lang.String property,
CometEvent event,
CometFilterChain chain)
Perform the filtering that has been configured for this Filter, matching against the specified request property. |
void |
setAllow(java.lang.String allow)
Set the regular expression used to test for allowed requests for this Filter, if any. |
void |
setDeny(java.lang.String deny)
Set the regular expression used to test for denied requests for this Filter, if any. |
Methods inherited from class org.apache.catalina.filters.FilterBase |
---|
destroy, getLogger, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.catalina.comet.CometFilter |
---|
doFilterEvent |
Methods inherited from interface javax.servlet.Filter |
---|
destroy, init |
Field Detail |
---|
protected java.util.regex.Pattern allow
protected java.util.regex.Pattern deny
Constructor Detail |
---|
public RequestFilter()
Method Detail |
---|
public java.lang.String getAllow()
null
.
public void setAllow(java.lang.String allow)
allow
- The new allow expressionpublic java.lang.String getDeny()
null
.
public void setDeny(java.lang.String deny)
deny
- The new deny expressionpublic abstract void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
process()
method to perform the actual filtering.
This method must be implemented by a concrete subclass.
doFilter
in interface Filter
request
- The servlet request to be processedresponse
- The servlet response to be createdchain
- The filter chain
java.io.IOException
- if an input/output error occurs
ServletException
- if a servlet error occursprotected void process(java.lang.String property, ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
property
- The request property on which to filterrequest
- The servlet request to be processedresponse
- The servlet response to be processed
java.io.IOException
- if an input/output error occurs
ServletException
- if a servlet error occursprotected void processCometEvent(java.lang.String property, CometEvent event, CometFilterChain chain) throws java.io.IOException, ServletException
property
- The property to check against the allow/deny rulesevent
- The comet event to be filteredchain
- The comet filter chain
java.io.IOException
- if an input/output error occurs
ServletException
- if a servlet error occurs
|
Apache Tomcat 7.0.22 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |