AOP常用表达式组合
execution(public * *(..)) // 所有public方法
execution(* set*(..)) // 所有set开头的方法
execution(public set*(..)) // 所有set开头的public方法
execution(public com.xyz.service.* set*(..)) // 所有位于包com.xyz.service下的,且以set开头的public方法
target(com.CommonService) // 所有实现了接口CommonService的类的方法
target(org.springframework.annotation.Transactional) // 所有用@Transactional的方法
within(org.springframework.stereotype.Controller) // @Controller的方法

本文详细解析了AOP(面向切面编程)中常用的表达式组合,包括针对不同方法、目标类、注解及包路径的精确匹配策略,是理解和应用AOP不可或缺的指南。
308

被折叠的 条评论
为什么被折叠?



