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.
| Modifier and Type | Field and Description |
|---|---|
| protected Pattern | allow
The regular expression used to test for allowed requests. |
| protected Pattern | deny
The regular expression used to test for denied requests. |
| protected int | denyStatus
The HTTP response status code that is used when rejecting denied request. |
| private static final String | PLAIN_TEXT_MIME_TYPE
mime type -- "text/plain" |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | doFilter(ServletRequest
The servlet request to be processed request, ServletResponse The servlet response to be created response, FilterChain The filter chain chain)Redeclares jakarta. Extract the desired request property, and pass it (along with the specified request and response objects) to the
protected |
| public String | Returns: the regular expression used to test for allowed requests for this Filter, if any; otherwise, returnnull.
|
| public String | Returns: the regular expression used to test for denied requests for this Filter, if any; otherwise, returnnull.
|
| public int | |
| private boolean | |
| protected boolean | isConfigProblemFatal()
Overrides org. Determines if an exception when calling a setter or an unknown configuration attribute triggers the failure of the this filter which in turn will prevent the web application from starting. |
| protected void | process(String
The request property on which to filter property, ServletRequest The servlet request to be processed request, ServletResponse The servlet response to be processed response, FilterChain The filter chain chain)Perform the filtering that has been configured for this Filter, matching against the specified request property. |
| private void | |
| public void | |
| public void | |
| public void | setDenyStatus(int
The status code for deny denyStatus)Set response status code that is used to reject denied request. |
| allow | back to summary |
|---|---|
| protected Pattern allow The regular expression used to test for allowed requests. | |
| deny | back to summary |
|---|---|
| protected Pattern deny The regular expression used to test for denied requests. | |
| denyStatus | back to summary |
|---|---|
| protected int denyStatus The HTTP response status code that is used when rejecting denied request. It is 403 by default, but may be changed to be 404. | |
| PLAIN_TEXT_MIME_TYPE | back to summary |
|---|---|
| private static final String PLAIN_TEXT_MIME_TYPE mime type -- "text/plain" | |
| RequestFilter | back to summary |
|---|---|
| public RequestFilter() | |
| doFilter | back to summary |
|---|---|
| public abstract void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException Redeclares jakarta. Extract the desired request property, and pass it (along with the specified request and response objects) to the
protected
| |
| getAllow | back to summary |
|---|---|
public String getAllow()
| |
| getDeny | back to summary |
|---|---|
public String getDeny()
| |
| getDenyStatus | back to summary |
|---|---|
public int getDenyStatus()
| |
| isAllowed | back to summary |
|---|---|
| private boolean isAllowed(String property) Process the allow and deny rules for the provided property.
| |
| isConfigProblemFatal | back to summary |
|---|---|
| protected boolean isConfigProblemFatal() Overrides org. Doc from org. Determines if an exception when calling a setter or an unknown configuration attribute triggers the failure of the this filter which in turn will prevent the web application from starting.
| |
| process | back to summary |
|---|---|
| protected void process(String property, ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException Perform the filtering that has been configured for this Filter, matching against the specified request property.
| |
| sendErrorWhenNotHttp | back to summary |
|---|---|
| private void sendErrorWhenNotHttp(ServletResponse response) throws IOException | |
| setAllow | back to summary |
|---|---|
| public void setAllow(String allow) Set the regular expression used to test for allowed requests for this Filter, if any.
| |
| setDeny | back to summary |
|---|---|
| public void setDeny(String deny) Set the regular expression used to test for denied requests for this Filter, if any.
| |
| setDenyStatus | back to summary |
|---|---|
| public void setDenyStatus(int denyStatus) Set response status code that is used to reject denied request.
| |