Use the Intercepting Filter pattern to modify requests being sent to servlets, or to modify responses being sent to users.
Intercepting Filter functions
Can intercept and/or modify requests before they reach the servlet.
Can intercept and/or modify responses before they are returned to the client.
Filters are deployed declaratively using the DD.
Filters are modular so that they can be executed in chains.
Filters have lifecycles managed by the Container.
Filters must implement Container callback methods.