Java 将第二条路径添加到excludePathPattern无效(springboot拦截器)
如您所见,“Java 将第二条路径添加到excludePathPattern无效(springboot拦截器),java,spring-boot,Java,Spring Boot,如您所见,“/file/download/*”无效,但“/file/show/*”有效。请帮助我,谢谢。您可以通过以下方式将排除模式传递到您的拦截器注册: 这不起作用,“/file/download/*”仍然被拦截这真的很奇怪,为什么第一个模式是validHey@super,被拦截路由的完整路径是什么?完整路径?本地主机:8080/file/**?例如,localhost:8080/file/delete/{id} public void addInterceptors(InterceptorR
/file/download/*
”无效,但“/file/show/*
”有效。请帮助我,谢谢。您可以通过以下方式将排除模式传递到您的拦截器注册:
这不起作用,“/file/download/*”仍然被拦截这真的很奇怪,为什么第一个模式是validHey@super,被拦截路由的完整路径是什么?完整路径?本地主机:8080/file/**?例如,localhost:8080/file/delete/{id}
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(sessionInterceptor)
.addPathPatterns("/file/**")
.excludePathPatterns("/file/show/*","file/download/*")
.addPathPatterns("/*_admin");
}
registry.addInterceptor(sessionInterceptor).
addPathPatterns("/file/**").excludePathPatterns(Arrays.asList("/file/show/*","file/download/*"))
.addPathPatterns("/*_admin");