切面的优先级、重(chong)用切点表达式

切面的优先级:

    @Order(1)

    @Order(2)

    数字越小,优先级越高


重(chong)用切点表达式:

class  
{
	//定义一个方法,用于生命切入点表达式。
	//一般该方法中不再需要填入其他代码
	@Pointcut("excution(public 返回类型.包名.类名.方法名(int,int))")
	public void declareJoinPointExpression(){}
}
@Before("declareJoinPointExpression()")
public void beforeMethod(JoinPoint joinPoint){
	...
}


猜你喜欢

转载自blog.csdn.net/lky888666/article/details/80665513
今日推荐