How to specify order of spring handler interceptors in xml configuration file?

Viewed 729

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

Thanks to M. Deinum. The order in which you define interceptors is the order they get executed.

Related