A Servlet filter intercepts the servlet request and response data so that this data can be modified or used in some way. A filter can be defined to apply to all servlet (JSP) requests and responses and thus are a means to achieve better servlet code modularization and reuse. There are many uses for servlet filters such as response data transformation (e.g., HTML to WML), request authentication and authorization, data validation, and data localization.
Lifecycle Events
The new servlet lifecycle events are generated by the servlet container in response to a change in a servlet's context or session. An application can register listeners for events signaling the creation or destruction of the servletContext or HTTPSession objects or changes in attributes of these objects.
Internationalization (I18N) Support
With the new internationalization support, a servlet can now specify which character set encoding is used to parse the request or set the response. This feature makes it easier for servlets to handle forms with parameters or content encoded in various ways other than the default ISO 8859-1 encoding.