The Servlet filters are components that can intercept an incoming request and outgoing response before it gets to a Java Servlet. The filters can be chained together through the configuration of the web deployment descriptor or through the annotations. Filters do not normally generate the content, rather they are designed to transform, modify, or adapt a request around a resource. The filters can be used for logging, security, and performance monitoring.
A Servlet filter implements the
javax.servlet.Filter interface. A Servlet filter implements the
doFilter() method, which takes three arguments:
FilterChain is a simple interface with one method
doFilter(), which ...