Spring AOP的几个概念点
一、基于Annotation实现AOP
1.1、引入AOP的包, 设置schema
1.2、打开基于Annotation的AOP
在SpringBean.xml中添加如下标签
1.3、引入Aspect的依赖对于Spring而言, 它使用的是第三方的AspectJ,我们需要另外导入包。
org.aspectj
aspectjrt
1.7.4
Spring AOP的几个概念点
在SpringBean.xml中添加如下标签
org.aspectj
aspectjrt
1.7.4
@Compontment("logAspect"), 让这个类被Spring所管理@Aspect 申明该类为切面类
微信扫码登录