如果在WEB.XML中有多个Filter,则执行顺序为
<filter-mapping>的顺序
<filter-mapping>
<filter-name>secondFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sysoutFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
执行顺序为 secondFilter, sysoutFilter
Configuring a Chain of Filters
WebLogic Server creates a chain of filters by creating a list of all the filter mappings that match an incoming HTTP request. The ordering of the list is determined by the following sequence:
In your filter class, use the FilterChain.doFilter()
method to invoke the next item in the chain.