Q:

Java servlet filter parameter

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!

A:

No. What you would have to do is declare the filter once for each combination of parameters you want to use and then map the right filter with the right combination of parameters to the appropriate URL.

