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))"
相关推荐
短剑重铸之日7 小时前
《7天学会Redis》Day 5 - Redis Cluster集群架构
数据库·redis·后端·缓存·架构·cluster
计算机程序设计小李同学8 小时前
基于SSM框架的动画制作及分享网站设计
java·前端·后端·学习·ssm
+VX:Fegn08958 小时前
计算机毕业设计|基于springboot + vue小型房屋租赁系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
Victor3568 小时前
Hibernate(43)Hibernate中的级联删除如何实现?
后端
Victor3568 小时前
Hibernate(44)Hibernate中的fetch join是什么?
后端
nimadan129 小时前
**手机小说扫榜工具2025推荐,精准追踪榜单动态与题材风向
python·智能手机
编程武士9 小时前
Python 各版本主要变化速览
开发语言·python
傻啦嘿哟9 小时前
Python中的@property:优雅控制类成员访问的魔法
前端·数据库·python
sky172010 小时前
VectorStoreRetriever 三种搜索类型
python·langchain
用户307500930379310 小时前
go Eino使用ADK开发agent
后端