
spring
guodayea
这个作者很懒,什么都没留下…
展开
-
MethodInterceptor 的几种用法(二)
前言发现写着写着好像越来越偏离正轨了,果然还是知道得太少了;这篇算是MethodInterceptor的第二篇了吧,本来没想写这篇文章的,但是看了看源码,颠覆我之前已有的认知,感觉还是得把这篇文章写出来;正文上一篇MethodInterceptor的文章都是以配置注解的形式来将MethodInterceptor注册生效,这次这篇将使用spring原生的类或接口来将MethodInterceptor注册并生效。TestInterceptorAnnotation先自定义注解TestIntercepto原创 2020-07-02 22:35:22 · 1423 阅读 · 0 评论 -
MethodInterceptor 的几种用法
前言最近在看springboot的@EnableAsync的源码,发现还是需要提前看一些东西,比如这次的MethodInterceptor接口的作用;如今springboot都到2.0以后了,我谷歌出来好多文章都是用的配置文件,本篇就用纯代码的形式来说明MethodInterceptor的用法;正文项目使用springboot的2.3.0.RELEASE版本构建,其中需要注意导入aop的starter; <dependency> <groupI原创 2020-06-08 21:17:45 · 10110 阅读 · 1 评论