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))"
相关推荐
i220818 Faiz Ul几秒前
药店管理|基于springboot + vue药店管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·美食分享系统
码云骑士17 分钟前
09-Python模块导入机制-sys.path与循环导入的死锁式排查
开发语言·python
天佑木枫33 分钟前
第5天:循环 —— 让程序重复执行
python
聆风吟º34 分钟前
【Python编程日志】Python基础数据类型完整梳理
开发语言·python·数据类型
盼小辉丶36 分钟前
OpenCV-Python实战(28)——OpenCV计算摄影从HDR图像融合到全景拼接
python·opencv·计算机视觉
weixin_3077791340 分钟前
在 Azure 上构建数据库路由与异构整合层:原理、方案与最佳实践
数据库·人工智能·后端·云计算·azure
都说名字长不会被发现41 分钟前
Spring Boot Starter 中间件账号密码加密方案设计与实现
java·spring boot·后端·中间件
shchojj1 小时前
ChatGPT Prompt Engineering for Developers - Expanding
开发语言·python·prompt
俊俊谢1 小时前
【python】FastAPI 实时推送:从 SSE 到 WebSocket
python·websocket·fastapi
stephon_1002 小时前
Agent 接入 MCP 后上下文爆炸、工具选串?一种“按需激活“的工具加载方案(含实现)
人工智能·python·ai