springAOP切入点表达式怎么排除某些方法

springAOP切入点表达式怎么排除某些方法

@Pointcut("!execution(* aa.bb..*.set*(..)) and execution(* aa.bb..*.*(..)) ")
如果是这种形式的方法执行了很多其他方法,比如init

可以 把   and  换成 &&  就可以解决了。

@Pointcut("execution(* aa.bb..*.*(..)) && !execution(* aa.bb..*.set*(..)) ")
这种形式都执行了排除了 “以set开头的方法名” 的方法

 
————————————————
原文链接:https://blog.csdn.net/a863922230/article/details/78431494

你可能感兴趣的:(spring,springBoot)