Spring扩展点应用

HandlerInterceptorAdapter+authorizationInterceptor

HandlerInterceptorAdapter相当于一个Filter拦截器,但是这个颗粒度更细,能使用Spring的@Autowired注入。重写public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)方法,可在执行请求之前做判断,比如判断登录、权限信息等
authorizationInterceptor类似于配置Mapping的路径,可以控制上述拦截的路径:比如说排除登录请求验证~,其他路径都需要验证

猜你喜欢

转载自blog.csdn.net/weixin_40401730/article/details/89398623