aop日誌記錄

servlet.web.xml中配置:

自動爲spring容器中配置了@aspectJ 切面的bean創建代理 織入切面,proxy-target-class="true"表示使用CGLIB動態代理的方式織入

 <aop:aspectj-autoproxy proxy-target-class="true"/> 

創建bean,以下示例是基於註解的切入。

在使用了@annotation的方法切入

注意!@Around是可以同時在所攔截方法的前後執行一段邏輯

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章