javax.servlet
Interface Filter

All Known Subinterfaces:
CometFilter
All Known Implementing Classes:
AmberContextFilter, AnonymousExpiresFilter, CsrfFilter, ErrorFilter, ErrorPageFilter, ExpiresFilter, GzipFilter, HeaderFilter, MD5Filter, PasswordFilter, ProfilerFilter, SSIFilter, ThrottleFilter, TransactionFilter, XsltFilter

public interface Filter

Filters the request or response to a servlet. Filters will typically call the next filter in the chain, eventually reaching the servlet at the bottom.

Since:
Servlet 2.3

Method Summary
 void destroy()
          Cleanup the filter.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          doFilter performs the actual work of a filter, either modifying the request or the response.
 void init(FilterConfig filterConfig)
          Initialize the filter.
 

Method Detail

init

void init(FilterConfig filterConfig)
          throws ServletException
Initialize the filter.

Throws:
ServletException

doFilter

void doFilter(ServletRequest request,
              ServletResponse response,
              FilterChain chain)
              throws ServletException,
                     java.io.IOException
doFilter performs the actual work of a filter, either modifying the request or the response. It will typically call the chain.doFilter() to invoke the next filter in the chain.

Parameters:
request - the servlet request
response - the servlet response
chain - the next filter in the chain
Throws:
ServletException
java.io.IOException

destroy

void destroy()
Cleanup the filter.