I have a filter which I want to use on multiple pages:
<filter>
<filter-name>PermissionFilter</filter-name>
<filter-class>filters.PermissionFilter</filter-class>
</filter>
.......
<filter-mapping>
<filter-name>PermissionFilter</filter-name>
<url-pattern>/faces/folder1</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>PermissionFilter</filter-name>
<url-pattern>/faces/folder2</url-pattern>
</filter-mapping>
It is possible to specify a parameter(s) in filter mapping? Something like that:
<filter-mapping>
<filter-name>PermissionFilter</filter-name>
<url-pattern>/faces/folder2</url-pattern>
<init-param>
<param-name>permission</paramn-name>
<param-value>permssionNameWhichIWantToVerify</param-value>
</init-param>
Thank you!
不需要。您要做的是为要使用的每个参数组合声明一次过滤器,然后将具有正确参数组合的正确过滤器映射到适当的URL。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.