spring中AOP同时支持JDK动态代理和CGLIB。
如何强制使用CGLIB实现AOP?
如果使用的注释配制aop,在<aop:aspectj-autoproxy>标签中添加。
<aop:aspectj-autoproxy proxy-target-class="true"/>
如果使用的是配制文件方式,在<aop:config>标签中添加。
<aop:config proxy-target-class="true">