Reputation: 2587
I want to use two handler interceptors in my spring project. First interceptor to authenticate token. Second interceptor to store authenticated token in spring context. I am using xml interceptor configuration. How to specify order for handler interceptors.
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**" />
<bean class="com.megapath.interceptor.TokenValidatorInterceptor">
</bean>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/**" />
<bean class="com.megapath.interceptor.TokenStoreInterceptor">
</bean>
</mvc:interceptor>
</mvc:interceptors>
Upvotes: 4
Views: 1667
Reputation: 2587
Thanks to M. Deinum. The order in which you define interceptors is the order they get executed.
Upvotes: 1