springmvc Interceptor 配置
@Override
public void addInterceptors(InterceptorRegistry registry) {
//super.addInterceptors(registry);
SecurityHandlerInterceptor interceptor = new SecurityHandlerInterceptor();
registry.addInterceptor(interceptor).addPathPatterns("/**").excludePathPatterns(Constant.LOGIN_ACTION_URL);
}
addPathPatterns配了之后excludePathPatterns才生效
证据在此
InterceptorRegistration.class
protected Object getInterceptor() {
if (this.includePatterns.isEmpty()) {
return this.interceptor;
}
return new MappedInterceptor(toArray(this.includePatterns), toArray(this.excludePatterns), interceptor);
}