JavaFilter的执⾏顺序
When more than one filter is mapped to a given resource, the Container us the following rules:
sort
说⽩了就两条:
1)先执⾏带有url-pattern标签的filter,再执⾏带有rvlet-name标签的filter。两种标签的书写⽅式如下:<filter-mapping>
<filter-name>BeerRequest1</filter-name>
<url-pattern>*.do</url-pattern>西南大学网络教育学院
</filter-mapping>noi
caman<filter-mapping>
2011湖北高考分数线
<filter-name>BeerRequest2</filter-name>
<rvlet-name>AdviceServlet</rvlet-name>
</filter-mapping>
前者优先执⾏。
2)如果同为url-pattern或rvlet-name,则会按照在l中的声明顺序执⾏。
下⾯举个例⼦:
<filter-mapping>
<filter-name>Filter1</filter-name>
<url-pattern>/Recipes/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter2</filter-name>
<rvlet-name>/Recipes/HopsList.do</rvlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Filter3</filter-name>
下午的英文
<url-pattern>/Recipes/Add/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter4</filter-name>
<rvlet-name>/Recipes/Modify/ModRecipes.do</rvlet-name>
gender是什么意思</filter-mapping>
<filter-mapping>
<filter-name>Filter5</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Request path Filter Sequence不结婚 日剧
/Recipes/HopsReport.do 1, 5
/Recipes/HopsList.do 1, 5, 2
/Recipes/Modify/ModRecipes.do 1, 5, 4
/HopsList.do 5
内容英文>yihu
/Recipes/Add/AddRecipes.do 1, 3, 5