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))"
相关推荐
小满zs17 分钟前
Go语言第三章(五谷轮回)
后端·go
tkevinjd3 小时前
MiniCode 项目详解6:原项目控制系统的10个缺陷(已修复)
python·llm·agent
dNGUZ7UGj4 小时前
10分钟完成第一个Python小游戏
python·django
没有梦想的咸鱼185-1037-16634 小时前
AI-Python机器学习与深度学习技术:CNN/Transformer/扩散模型、SHAP可解释及Hermes智能体自动化
人工智能·python·深度学习·机器学习·chatgpt·cnn·transformer
霸道流氓气质4 小时前
SpringBoot中通用工具类库(Utils)封装与使用实践
spring boot·后端·python
Draina6 小时前
CBC填充预言攻击-CBC Padding Oracle Crypto Attack
python·安全·web安全·网络安全·密码学·安全性测试
Angel Q.7 小时前
特征提取 | DINO 到 DINOv3
图像处理·python
不如语冰7 小时前
AI大模型入门-pytorch-张量2 tensor创建
python
NPE~7 小时前
[AI]Agent开发——ADK框架使用
人工智能·python·ai·教程·adk·agent开发