Suppose i have following in my web.xml
<filter-mapping>
<filter-name>F1</filter-name>
<url-pattern>/XYZ/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>F2</filter-name>
<url-pattern>/XYZ/abc.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>F3</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
What will be the order in which the filters will be called if a request comes as /XYZ/abc.do.And why?
In the order their mappings are defined in web.xml
If using annotations (@WebFilter
) the order seems to be undefined - you still have to declare the <filter-mapping>
entries in web.xml.