Makoto
Makoto

Reputation: 775

exclude pattern with spring interceptor

I am using a spring interceptor and I want to exclude only the first page in my application. The first page serves to authenticate then redirects towards other pages.

so I wrote in my config file

<mvc:interceptors>
    <mvc:interceptor>
    <mvc:exclude-mapping path="/" />
    <bean class="com.app.interceptor.AuthentificationInterceptor">
    </bean>
   </mvc:interceptor>
</mvc:interceptors> 

But I got an error in the deployement. Where did I go wrong ?

Upvotes: 1

Views: 1770

Answers (1)

Makoto
Makoto

Reputation: 775

I am sorry, I made a mistake. I made a confusion between the path that I saw in the URL (the first page in the URL was located at the root of the app, hence the "/"), and the path of my restangular call in the first page, which was "/contexte".

So I wrote

    <mvc:interceptors>
    <mvc:interceptor>
      <mvc:mapping path="/**" />
       <mvc:exclude-mapping path="/contexte/**" />
    <bean class="fr.smabtp.ig.saisines.metier.interceptor.AuthentificationInterceptor">
    </bean>
     </mvc:interceptor>
</mvc:interceptors> 

and it works fine.

Upvotes: 2

Related Questions