Spring中的类基本都会标注解,所以使用注解匹配切点可以满足绝大部分需求

主要使用@within()/@target @annotaton() @args()等...

 

匹配@Service类中的所有方法:

@within(org.springframework.stereotype.Service)

 或

@target(org.springframework.stereotype.Service)

 

匹配标注了@RequestMapping的所有方法

@annotation(org.springframework.web.bind.annotation.RequestMapping)

 

匹配参数中有@RequestBody的所有方法

@args(org.springframework.web.bind.annotation.RequestBody)

 

 

 

注:有关注解的AspectJ指示器只作用于目标Class,即当这类指示器指向interface时,不能匹配实现类

 

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2021-10-24
  • 2021-06-25
  • 2021-10-24
  • 2022-12-23
猜你喜欢
  • 2021-05-30
  • 2021-12-27
  • 2022-12-23
  • 2018-06-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案