拦截器配置

  拦截器(Interceptor)实现对每一个请求处理前后进行相关的业务处理,类似于Servlet的Filter。

  可让普通Bean实现HanlderInterceptor接口或者继承HandlerInterceptorAdapter类实现自定义拦截器。

  通过重写WebMvcConfigurerAdapter的addInterceptor方法来注册自定义的拦截器。

原文地址:https://www.cnblogs.com/yourGod/p/9116688.html