我需要 Spring AOP 切入点解释
我看到了切入点模式的两种变体:
This
execution(* some.package.*.*(..))
和 this
execution(* some.package.* *(..))
最后两个 * 之间的点(或不存在)的含义是什么?
I have seen two variations of pointcut patterns:
This
execution(* some.package.*.*(..))
and this
execution(* some.package.* *(..))
What is the meaning of the dot (or of it absence) between the last two *'s?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个附录定义了切入点表达式语言的语法。对于执行表达式,规则如下:
where
这意味着如果在“(”之前有 3 个表达式(用空格分隔),则第一个是修饰符,第二个是类,第三个是方法名称。但是如果有 2 个表达式在“(”之前,第一个是类,第二个是方法名称。
This appendix defines grammar of the pointcut expression langauge. For the execution expression the rule is the following:
where
That means that if you have 3 expressions (separated by space) before "(", then the first is modifier, second is class and third is method name. But if you have 2 expressions before "(", then first will be class and second will be method name.