I have a MVC Java configuration but the HandlerInterceptor
is not excluding some patterns.
At the line marked with xxx, if
1) I add both addPatterns("/**")
and excludePathPatterns("*.ecxld")
to the HandlerInterceptor
's InterceptorRegistration
, the HandlerInterceptor.preHanlde()
is NOT invoked at all. e.g .addPathPatterns("/**").excludePathPatterns("*.ecxld")
2) I add only excludePathPatterns("*.ecxld")
to the HandlerInterceptor
's InterceptorRegistration
, the HandlerInterceptor.preHanlde()
is still executed.
(the other interceptors are invoked fine).
Any pointers appreciated.
Thanks
@Configuration
public class MyMVCConfigurerAdapter extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(final InterceptorRegistry registry) {
registry.addInterceptor(getInterceptorOne());
registry.addInterceptor(getMyHandlerInterceptor())
.excludePathPatterns("*.ecxld"); // **xxx**
registry.addInterceptor(getInterceptorTwo()
);
}