O'Reilly logo

Servlet, JSP and Spring MVC: A Tutorial by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9

Filters

A filter is an object that intercepts a request and processes the ServletRequest or the ServletResponse passed to the resource being requested. Filters can be used for logging, encryption and decryption, session checking, image transformation, and so on. Filters can be configured to intercept a resource or multiple resources.Filter configuration can be done through annotations or the deployment descriptor. If multiple filters are applied to the same resource or the same set of resources, the invocation order is sometimes important and in this case you need the deployment descriptor.

This chapter explains how to write and register filters. Several examples are also given.

The Filter API

The following section explains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required