1

我有这样的过滤器配置:

<filter>
    <filter-name>Jersey Web Application</filter-name>
    <filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
    <init-param>
        <param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
        <param-value>/(images|js|styles|(WEB-INF/jsp))/.*</param-value>
    </init-param>
    <init-param>
        <param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
        <param-value>/WEB-INF/jsp</param-value>
    </init-param>
    <init-param>
        <param-name>com.sun.jersey.config.property.packages</param-name>
        <param-value>pl.psnc.dl.wf4ever</param-value>
    </init-param>
    <init-param>
        <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
        <param-value>pl.psnc.dl.wf4ever.auth.SecurityFilter</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>Jersey Web Application</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

我想保留这个过滤器

<param-value>pl.psnc.dl.wf4ever.auth.SecurityFilter</param-value>

但我还需要添加与此非常相似的下一个过滤器。我如何定义使用下一个 fitler 让我们说

 <param-value>pl.psnc.dl.wf4ever.auth.SecurityFilterAdmin</param-value>
4

1 回答 1

4

请参阅Jersey API; ,您可以指定多个过滤器类,由、,或空格分隔。

<init-param>
    <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
    <param-value>foo.Bar;foo.Baz</param-value>
</init-param>
于 2013-10-21T14:07:53.433 回答