Modifying The Main Filter Chain
The main filter chain is a standard servlet filter chain, and can be modified in the normal way. To insert a filter of your own, for example, you would need to:
-
Write your own filter class that implements the interface
javax.servlet.Filter
-
Declare and configure it by adding a filter element to
WEB.XML
-
Insert it into the filter chain by modifying the filter chain mapping in
WEB.XML
For further information, see http://docs.oracle.com/javaee/6/tutorial/doc/bnagb.html.