如果是SpringMVC 的intercepter
Java Annotation config中
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = { "com.test" })
@EnableAspectJAutoProxy(proxyTargetClass = true)
class ApplicationConfig extends WebMvcConfigurerAdapter {
@Autowired
AuthenticationInterceptor authenticationInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(accessInterceptor).addPathPatterns("/**").excludePathPatterns("/test");
}
}