Reputation: 3481
I have two filters. And the url-pattern
are respectively:
<filter>
<filter-name>ListFilter</filter-name>
<filter-class>mypackage.ListFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ListFilter</filter-name>
<url-pattern>/list.jsp</url-pattern>
</filter-mapping>
<filter>
<filter-name>AllFilter</filter-name>
<filter-class>mypackage.servlet.AllFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AllFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Then how will the two filters work if user access list.jsp?
Upvotes: 1
Views: 569
Reputation: 21981
Then how will the two filters work if user access list.jsp?
The answer of this question is following image:
For details go to this tutorial
Upvotes: 1
Reputation: 262842
All filters will get applied, in the order they are defined in web.xml.
For servlets, obviously only one can be executed, and this will be the most specific match.
Upvotes: 0