Summary: | Tomcat7 filters from conf/web.xml are applied after filters defined in WEB-INF/web.xml | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | charlie <charlesk40> |
Component: | Servlet & JSP API | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | areese |
Priority: | P2 | ||
Version: | 7.0.19 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
charlie
2011-09-01 19:48:01 UTC
The short answer is that this can't be fixed. The comment at the beginning of the webConfig() methods explains why (there were a number of spec breaking bugs introduced by trying to process the global web.xml file earlier). I am not aware of the spec even mentioning default web.xml settings provided by the container. This is likely to vary from container to container. I would suggest the following: - Define a ServletContextListener in conf/web.xml - Use this to add the filters programmatically during the contexInitialized() - Use the isMatchAfter parameter of the addMappingXXX methods of FilterRegistration to insert the filters before those defined in any web.xml Bugzilla isn't really the place to go into details on exactly how to do this. If the above isn't enough, please use the Tomcat users mailing list for further advice. |