servlet-filters precedence
Since since filters are chained one after another, I cannot know when to remove MDC/NDC (log4j) information. Which is the topmost servlet filter?
I have one defined inside deploy/jboss-portal-ha.sar/portal-server.war/WEB-INF/Web.xml and several others spr开发者_如何转开发ead around the application server.
What's the rule of precedence in this case?
Servlet filters are chained in the order that they are defined within your web.xml, and should be specific to each web application context - which is almost always synonymous with a web application archive (WAR).
Details around the exact ordering used (which takes both the <url-pattern>
and <servlet-name>
elements into account) are documented in the Java Servlet Specification under "SRV.6.2.4 Configuration of Filters in a Web Application", available for download at http://download.oracle.com/otndocs/jcp/servlet-2.5-mrel2-eval-oth-JSpec/.
精彩评论