June 2005
Beginner to intermediate
336 pages
6h 29m
English
You don't have to change a web resource, such as a JSP page, HTML page, or a servlet, to log users who come to that resource, to restrict access to it, to alter the data sent to it, or to alter the data that comes back from it. All you need is a filter.
Creating a new filter isn't hard; it's just a Java class that implements the javax.servlet.Filter interface. You can see all the methods of this interface in Table 6.1.
| Method | Does This |
|---|---|
| void destroy() | Called to indicate that a filter is being destroyed |
| void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | Called when control is being passed to the filter |
| void init(FilterConfig filterConfig) | Called ... |
Read now
Unlock full access