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))"
相关推荐
都在酒里19 分钟前
嵌入式台架自动化:用 Python 回归测试 RS-485 和 CAN
网络·python·自动化
Javatutouhouduan24 分钟前
阿里Java面试核心讲(2027最新版)
java·spring boot·mybatis·java面试·后端开发·java程序员·java八股文
垆边人似月.30 分钟前
机器人交互测评(二):测试场景设计与Python自动化测试实战
python·机器人·交互
爱嘿嘿的小黑44 分钟前
用 Google Antigravity 踩遍登录和环境坑后,我开源了个 30 秒只读体检脚本 + Agent Skill
人工智能·python·github
ComPDFKit1 小时前
扫描对账单 PDF 转 Excel,怎么查出金额错行?
python·pdf·excel
小白的高手之路1 小时前
【LeetCode 热题 100】206. 反转链表|链表、迭代、递归(Python)
笔记·python·算法·leetcode·链表·职场和发展·力扣
源码_空间1 小时前
基于Springboot的在线错题本与复习计划系统(源码+文档)
java·spring boot·后端
Rain的Java大神之路2 小时前
别再用“延迟双删”赌一致性:Canal + RocketMQ + Redis 的工业级缓存失效链路,以及 MySQL 分库分表前必须算清的那笔账
java·后端·面试
himobrinehacken2 小时前
HackMyVM靶机Yulian
java·spring boot·后端
CoderYanger2 小时前
Java EE 进阶:16. Spring原理(第一弹)
java·服务器·数据库·后端·spring·java-ee·github