SpringBoot AOP切入点表达式

介绍

在AOP中可以通过注解来定义 切入点表达式来控制被监控的方法。

匹配所有 com.example.service 包下以 Service 结尾的方法:

java 复制代码
"execution(* com.example.service.*Service.*(..))"

匹配任意类的 public 方法:

java 复制代码
"execution(public * *(..))"

匹配 com.example.service 包及其子包下的任意方法:

java 复制代码
"execution(* com.example.service..*.*(..))"

匹配 MyService 类中的 doSomething 方法:

java 复制代码
"execution(* com.example.service.MyService.doSomething(..))"

匹配 com.example.service 包中的任何类的 save 方法,且方法参数为 java.lang.String 类型

yaml 复制代码
"execution(* com.example.service.*.save(java.lang.String))"
相关推荐
智算菩萨12 分钟前
OpenCV色彩空间转换实战:BGR转HSV/LAB的工业应用场景详解(含自动化脚本)
人工智能·python·opencv·计算机视觉·自动化·音视频
Carsene13 分钟前
开源项目文档架构设计:Git Submodule 实现文档与代码的优雅分离
前端·后端
曲幽15 分钟前
别再数据线了!用FastAPI 5分钟搭个局域网文件+剪贴板神器
python·fastapi·web·async·clipboard·fileupload
吾诺15 分钟前
Spring Boot 整合 Redis 步骤详解
spring boot·redis·bootstrap
AbsoluteLogic17 分钟前
Python——必学内置模块 OS
python
indexsunny18 分钟前
互联网大厂Java面试:从Spring Boot到微服务的逐步挑战
java·数据库·spring boot·redis·微服务·面试·电商
sqyno1sky21 分钟前
游戏与图形界面(GUI)
jvm·数据库·python
用户83562907805127 分钟前
Python 实现 Word 文档图片插入与排版技巧
后端·python
2501_9454235436 分钟前
持续集成/持续部署(CI/CD) for Python
jvm·数据库·python
m0_6214385236 分钟前
用Python实现自动化的Web测试(Selenium)
jvm·数据库·python