Vinoth Kumar C M
Vinoth Kumar C M

Reputation: 10588

Configuring URL patterns for servlet filters

We are trying to use spring security in our application.

IN the below code, How do we configure the URL pattern to say

"intercept all the URLs except the URLs of pattern '/xyz/' " ?

Basically I want the filter to intercept all the URLs,but if an URL contains /xyz/ , it should not intercept it.

     <sec:filter-chain pattern="/**" filters="httpSessionContextFilter,
                                    filter_A,
                                    filter_B,
                                    exceptionTranslationFilter,
                                    authorizationFilter" />
    </sec:filter-chain-map>

Upvotes: 1

Views: 711

Answers (1)

Simeon
Simeon

Reputation: 7792

Try:

<intercept-url pattern="*/xyz/*" filters="none" />

filters="none" disables the filter chain for the given URL pattern.

Also I'd recommend enabling the spring debug log if you haven't already. So you can see exactly what's going on.

Upvotes: 2

Related Questions