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是可以同時在所攔截方法的前後執行一段邏輯