servlet.web.xml中配置:
自动为spring容器中配置了@aspectJ 切面的bean创建代理 织入切面,proxy-target-class="true"表示使用CGLIB动态代理的方式织入
<aop:aspectj-autoproxy proxy-target-class="true"/>
创建bean,以下示例是基于注解的切入。
在使用了@annotation的方法切入
注意!@Around是可以同时在所拦截方法的前后执行一段逻辑
servlet.web.xml中配置:
自动为spring容器中配置了@aspectJ 切面的bean创建代理 织入切面,proxy-target-class="true"表示使用CGLIB动态代理的方式织入
<aop:aspectj-autoproxy proxy-target-class="true"/>
创建bean,以下示例是基于注解的切入。
在使用了@annotation的方法切入
注意!@Around是可以同时在所拦截方法的前后执行一段逻辑
相关文章: