<aop:pointcut expression="切点表达式" id="aspect"/>
Aspect 切点表达式:
execution: 匹配指定的方法
execution(void perform()) 匹配项目下所有该方法
execution(void first.Singer.perform()) 匹配具体到某个类的该方法
execution(* first.Artist.perform()) 不考虑返回值类型
execution(* first.Artist.perform(..)) 不考虑返回值类型和参数列表
execution(* first.Aritst.perform(*,*)) 参数必须是两个
execution(* first.Artist.perform(..,java.lang.String))
execution(* find*(..)) 所有方法名符合findXxx 的方法
execution(* com.tarena.service.StoreService.*(..)) 该类中所有方法
execution(* com.tarena.service.*.*(..)) 该包中所有类的所有方法
execution(* com.tarena..*.*(..)) 该包及其子包中所有类的所有方法
within: 匹配类内的所有方法(必须是实现类,不能是接口)
-
在service包中的任意连接点(在Spring AOP中只是方法执行):
within(com.xyz.service.*)
-
在service包或其子包中的任意连接点(在Spring AOP中只是方法执行):
within(com.xyz.service..*)
-
实现了
AccountService
接口的代理对象的任意连接点 (在Spring AOP中只是方法执行):this(com.xyz.service.AccountService)
-
实现
AccountService
接口的目标对象的任意连接点 (在Spring AOP中只是方法执行):target(com.xyz.service.AccountService)
-
args(java.io.Serializable)
'args'在绑定表单中更加常用:。