@PointCut

@PointCut 由表示式和签名组成

1
2
3
4
//Pointcut表示式
@Pointcut("execution(* com.redis.test.Controller.*(..))")
//Point签名
private void log(){}

接下来可以使用point签名定义切点

1
2
@Before("log()")
xxxxx

其中Pointcut表示式中,*表示任意匹配,(..)表示方法可以有任意的参数,但是如(*,String)就表示匹配有两个参数且第二个参数为String的方法,..表示了子包。
所以

com.redis.test..*.*(..)

表示com.redis.test包下的所有子包的任意方法。

发表评论

邮箱地址不会被公开。 必填项已用*标注