Spring_day02_12(AOP的切点的配置)

AOP切入点的配置

<aop:pointcut expression="execution(* spring4_aop.ProductDaoImpl.add())" id="mypoint" />
规则:[访问修饰符] 方法返回值 包名.类名.方法名(方法参数)
[public] String Com.liubo.userDao.save(User)


1.2.2.2 execution(* ) 固定表达式,表示配置切点

1.2.2.3 * 替代包,类,方法  com.bjsxt.service.impl.TestServiceImpl.*()匹配TestServiceImpl中的所有无参方法
com.bjsxt.service.impl.TestServiceImpl.b(string,int)

1.2.2.4 .. 任意参数          com.bjsxt.service.impl.TestServiceImpl.*(..)匹配TestServiceImpl中的所有方法
      com.bjsxt.service.impl.*.*(..)匹配包中任意类的任意方法

<aop:pointcut expression="execute(* 切方法的权限定路径.方法名())" id="popint" />
*:第一个 * ,代表方法的返回值的类型是 任意类型
*:还可以替代包,类,方法
..:替代的是方法的参数,代表的是任意参数类型。或者是没有

猜你喜欢

转载自blog.csdn.net/strawberry_uncle/article/details/80646085