读书人

springmvc Interceptor 配备

发布时间: 2013-08-01 15:23:18 作者: rapoo

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);
}

读书人网 >VC/MFC

热点推荐