我想使用方法名称的一部分和通配符创建切点,例如:
myMethodWrite()
所以我的想法是这样的:
@Pointcut("execution(* br.com.spring.aop.*myMethod*.*(..))")
这样的事情可能吗?
最佳答案
是的,这是可能的。 Spring AOP documentation州
The name pattern matches the method name. You can use the
*
wildcard as all or part of a name pattern.
并给出一个例子
the execution of any method with a name beginning with "set":
execution(* set*(..))
关于java - 是否可以在 aop 中使用带有通配符的方法名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33505225/