是的,您可以使用它:示例:
@EnableWebMvc
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LocalInterceptor());
registry.addInterceptor(new SecurityInterceptor()).addPathPatterns("/secure/*");
}
}
只是指
有关更多详细信息,请访问http://static.springsource.org/spring/docs/3.1.x/spring- framework-reference/html/mvc.html#mvc-config- interceptors。