Provides an abstract class to be subclassed to create an HTTP filter suitable for a Web site. A subclass of
HttpFilter should override
doFilter(jakarta..
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.
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| 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 jakarta.
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 resource
The |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| 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 jakarta.
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
| |