org.jboss.web.tomcat.filters
Class RemoteHostFilter

java.lang.Object
  extended byorg.jboss.web.tomcat.filters.RemoteHostFilter

public class RemoteHostFilter
extends java.lang.Object

Accept or deny a request based on the IP address of the client who made the request. JDK 1.4 or higher is required.

This filter is configured by setting the "allow" and/or "deny" properties to a comma-delimited list of regular expressions (in the syntax supported by the java.util.regex package) to which the client IP address will be compared.

RemoteHostFilter org.jboss.remotehostfilter.RemoteHostFilter deny 128.0.*,192.4.5.7 allow 192.4.5.6,127.0.0.*

Evaluation proceeds as follows:

If there are any deny expressions configured, the IP will be compared to each expression. If a match is found, this request will be rejected with a "Forbidden" HTTP response. If there are any allow expressions configured, the IP will be compared to each such expression. If a match is NOT found, this request will be rejected with a "Forbidden" HTTP response. Otherwise, the request will be rejected with a "Forbidden" HTTP response.


Constructor Summary
RemoteHostFilter()
           
 
Method Summary
 void destroy()
          Destroy method for this filter
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
 void init(FilterConfig filterConfig)
          Init method for this filter
 java.lang.String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteHostFilter

public RemoteHostFilter()
Method Detail

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws java.io.IOException,
                     ServletException
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
chain - The filter chain we are processing
Throws:
java.io.IOException - if an input/output error occurs
ServletException - if a servlet error occurs

destroy

public void destroy()
Destroy method for this filter


init

public void init(FilterConfig filterConfig)
Init method for this filter


toString

public java.lang.String toString()
Return a String representation of this object.