Spring 入门-第十篇:Spring AOP 入门实践 1. 基于 XML 的 AOP 配置 1.1 切面配置基础 在 Spring 中,XML 方式通过 <aop:config> 标签定义 AOP 配置,核心标签包括: <aop:aspect>:声明切面,通过 ref 引用切面 Bean。 <aop:pointcut>:定义切入点表达式,通过 id 唯一标识。 关键属性: expression:切入点表达式(如 execution 匹配方法执行)。 示例:XML 切面基础配置 <!-- aop-config.xml -->