Spring 3 Interceptor Order

Viewed 11874

I have a Spring 3 Web App that implements two interceptors. Im using a config class annotated @Configuration. The code is as follows:

    @Override
public void addInterceptors(InterceptorRegistry registry) {
    // TODO Auto-generated method stub
    super.addInterceptors(registry);
    registry.addInterceptor(homeInterceptor()).addPathPatterns("/");
    registry.addInterceptor(allInterceptor());
}

No matter what order I add the interceptors to the registry, the allInterceptor's preHandle function is always called before the homeInterceptor's preHandle. Does anyone know how to control the order that interceptors are invoked?

Thanks!

2 Answers
Related