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))"
相关推荐
2301_322414280430 分钟前
基于SpringBoot+Vue的休闲零食超市管理系统的设计与实现59004-计算机毕设 原创(免费领源码+部署教程+开发环境)
java·vue.js·spring boot·redis·mysql·决策树·推荐算法
梦想不只是梦与想1 小时前
Python 中subprocess 模块:执行外部命令
python·subprocess·调用外部命令
懂点Tech2 小时前
ctfshow MISC入门图片篇(信息附加):misc41解题思路
开发语言·python
金銀銅鐵3 小时前
[Java] 用 GUI 展示 EnumSet 增减元素时的内部变化(上)
java·后端·ai编程
念何架构之路3 小时前
go-grpc设计思想
开发语言·后端·golang
system_error_x4 小时前
SpringBoot 集成 Thymeleaf 简洁入门
java·spring boot·后端
步行cgn5 小时前
Spring MVC 视图机制的核心接口与类
java·开发语言·后端·spring·mvc
码事漫谈6 小时前
AI 读你的提示词,其实很没耐心
后端
爱上纯净的蓝天6 小时前
不用云做 RAG:一个本地笔记问答工具的取舍与坑
python·开源·大模型·rag·本地部署
cspttty7 小时前
2027风险管理岗准备路线:数学与应用数学如何补齐金融、SQL与Python
开发语言·python·金融