在Spring的CGLib代理中遇到了如下问题:
意思是MethodInterceptor中不含有intercept
那么可能有人问为什么其他网上查询结果都是如此的?而到这里不行?
其实只是因为对包的导入错误,我们要导入的是cglib代理
因此选择是在cglib包内的MethodInterceptor即可
如果没有该选项,可以在pom.xml的配置文件导入进去,添加如下:
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>