spring_aop定义切点表达式详细解读

spring_aop定义切点表达式详细解读

项目结构如下
在这里插入图片描述
下面我们先看一组表达式

<aop:pointcut expression="execution(* com.service.Service*.*(..))" id="allMethod"/>

execution(* com.service.Service*.(…))
第一个
指的就是方法的返回类型 代表所有的返回类型(string void int Date等等)也写上明确的返回类型
下面的com.service就指的是包名了
再往下.Service
就指的是以Service开头的类型
再往下.*指的就是所指类下面的所有的方法
(…)就指匹配包含所有类型的参数的方法

猜你喜欢

转载自blog.csdn.net/weixin_44235109/article/details/96483909