SpringMVC
曹牛牛
这个作者很懒,什么都没留下…
展开
-
在 Interceptor 中使用 @autowired 自动注入
要使用 @autowired 自动注入,就需要知道该注解生效的条件1、@autowired 合适生效,即什么时候可以使用 @autowired 注解根据官方描述:You are free to use any of the standard Spring Framework techniques to define your beans and their injected depende...原创 2019-12-21 18:33:58 · 1748 阅读 · 0 评论 -
处理器拦截器(HandlerInterceptor)详解
简介SpringWebMVC的处理器拦截器,类似于Servlet开发中的过滤器Filter,用于处理器进行预处理和后处理。应用场景1、日志记录,可以记录请求信息的日志,以便进行信息监控、信息统计等。2、权限检查:如登陆检测,进入处理器检测是否登陆,如果没有直接返回到登陆页面。3、性能监控:典型的是慢日志。HandlerInterceptorpublic interface H...原创 2019-12-21 18:07:54 · 371 阅读 · 0 评论