Spring学习:AOP配置1(xml)
2017-04-19 08:38
323 查看
切面:aspect将一个bean作为切面类
切入点:pointcut
通知:Advice:有几种类型:before 、after-returning、after-throwing、after 、around
<aop:config>
<aop:aspect id="moocAspectAOP" ref="aspectbean">
<aop:pointcut id="moocpointcut" expression="execution(* aspect.biz.AspectBiz.*(..))" />
<aop:before pointcut-ref="moocpointcut" method="before" />
<aop:after-returning pointcut-ref="moocpointcut" method="after_returning" />
<aop:after-throwing pointcut-ref="moocpointcut" method="after_throwing" />
<aop:after pointcut-ref="moocpointcut" method="after" />
<aop:around pointcut-ref="moocpointcut" method="around" />
</aop:aspect>
</aop:config>
1.必须在项目中导入aspectj-1.8.9.jar,aspectjweaver.jar,aspects.jar,否则会出现ClassNotFound异常
切入点:pointcut
通知:Advice:有几种类型:before 、after-returning、after-throwing、after 、around
<aop:config>
<aop:aspect id="moocAspectAOP" ref="aspectbean">
<aop:pointcut id="moocpointcut" expression="execution(* aspect.biz.AspectBiz.*(..))" />
<aop:before pointcut-ref="moocpointcut" method="before" />
<aop:after-returning pointcut-ref="moocpointcut" method="after_returning" />
<aop:after-throwing pointcut-ref="moocpointcut" method="after_throwing" />
<aop:after pointcut-ref="moocpointcut" method="after" />
<aop:around pointcut-ref="moocpointcut" method="around" />
</aop:aspect>
</aop:config>
1.必须在项目中导入aspectj-1.8.9.jar,aspectjweaver.jar,aspects.jar,否则会出现ClassNotFound异常
相关文章推荐
- Spring学习之使用XML配置AOP
- Spring AOP基础知识学习——XML配置
- Spring学习-22:Spring的AOP:基于AspectJ的XML配置方式开发
- Spring学习一:IOC(控制反转)和AOP(面向切面)的xml配置和注解方式
- spring学习总结(十):基于 XML 的配置AOP
- Spring 4.0 学习日记(9) ---XML配置实现AOP切面
- Spring3.0 学习-AOP面向切面编程_Spring AOP的XML配置模式
- Spring视频学习(十)使用XML配置事务
- Spring-AOP配置(学习笔记)
- Spring aop注解方式和xml配置方式
- Java 学习笔记04:Spring XML配置文件Bean
- spring学习笔记8--使用spring进行面向切面的(AOP)编程(2)XML配置方式
- spring aop的使用(注解方式以及基于xml配置方式)
- spring使用AOP如何配置ApplicationContext.xml
- 一步一步深入spring(6)--使用基于XML配置的spring实现的AOP
- Spring Aop实例之xml配置
- spring 学习笔记 使用pojo+xml的方式开发aop
- Spring Aop实现——Annotation方式(注解式)and Schema-based式(xml配置)
- spring学习笔记12----Spring+jdbc组合开发( 采用基于xml方式配置事务)
- Spring Aop实现——Annotation方式(注解式)and Schema-based式(xml配置)