Provides an abstract class to be subclassed to create
an HTTP filter suitable for a Web site. A subclass of
HttpFilter should override doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain).
Filters typically run on multithreaded servers, so be aware that a filter must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections. See the Java Tutorial on Multithreaded Programming for more information on handling multiple threads in a Java program.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | doFilter(ServletRequest
a req, ServletResponse ServletRequest object that
contains the request the client has made
of the filtera res, FilterChain ServletResponse object that
contains the response the filter sends
to the clientthe chain)FilterChain for invoking the next filter or the resourceImplements javax. The |
| protected void | doFilter(HttpServletRequest
a req, HttpServletResponse HttpServletRequest object that
contains the request the client has made
of the filtera res, FilterChain HttpServletResponse object that
contains the response the filter sends
to the clientthe chain)FilterChain for invoking the next filter or the resourceThe |
| HttpFilter | back to summary |
|---|---|
| public HttpFilter() Does nothing, because this is an abstract class.
| |
| doFilter | back to summary |
|---|---|
| public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException Implements javax. The The default implementation inspects the incoming
| |
| doFilter | back to summary |
|---|---|
| protected void doFilter(HttpServletRequest req, HttpServletResponse res, FilterChain chain) throws IOException, ServletException The The default implementation simply calls
| |