WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
NEW MAVEN DEPENDENCIES FOR THIS CHAPTER
There are no new Maven dependencies for this chapter. Continue to use the Maven dependencies introduced in all previous chapters.
Filters are application components that can intercept requests to resources, responses from resources, or both, and act on those requests or responses in some manner. Filters can inspect and modify requests and responses, and they can even reject, redirect, or forward requests.
A relatively new addition to the Servlet specification, filters were added in Servlet 2.3, improved in Servlet 2.4, and haven’t really changed much since then. The
javax.servlet.Filter interface is very simple and involves the
HttpServletResponse that you are already familiar with. Like Servlets, filters can be declared in the deployment descriptor, programmatically, ...