speedingdeer
speedingdeer

Reputation: 1236

java jersay multiple ServletContainer Filters

I have a filter configuration like this:

<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>

I would like to keep this filter

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

but I need to add also next filter very similar to this one. How can I define to use next fitler lets say

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

Upvotes: 1

Views: 1356

Answers (1)

Heri
Heri

Reputation: 2124

See the Jersey API, you may specify multiple filter classes delimited by ;, , or space.

<init-param>
    <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
    <param-value>foo.Bar;foo.Baz</param-value>
</init-param>

Upvotes: 4

Related Questions