AOP切入點表達式

一、execution(public * * (..))spring

      表示無要求,只要是public修飾的方法就行代理


二、execution(* set*(..))xml

       只要以set打頭的方法就能夠io


三、execution(* com.ycl.service.AccountService.*(..))配置

      匹配是這個類com.ycl.service.AccountService.*(..)下的全部方法aop


四、execution(* com.ycl.service.AccountService..*.*(..))service

      注意:這個和上面的很像,就多個點兒,表示  service及其子包下全部方法(上面不包括子包)方法

 

五、多個execution時用 || 鏈接  execution(* com.ycl.service.AccountService.*(..))  ||execution(* com.ycl.service.AccountService..*.*(..))vi

PS:co

   controller 切面特殊性,由於controller是spring代理的,因此要aop切面的配置跟springMVC.xml放置在一塊兒。

相關文章
相關標籤/搜索