spring学习笔记(22)----基于配置文件的方式来配置AOP
来源:互联网 发布:vscode github 编辑:程序博客网 时间:2024/05/17 00:56
一个配置例子
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd"> <!-- 配置 bean --> <bean id="arithmeticCalculator" class="com.atguigu.spring.aop.xml.ArithmeticCalculatorImpl"></bean> <!-- 配置切面的 bean. --> <bean id="loggingAspect" class="com.atguigu.spring.aop.xml.LoggingAspect"></bean> <bean id="vlidationAspect" class="com.atguigu.spring.aop.xml.VlidationAspect"></bean> <!-- 配置 AOP --> <aop:config> <!-- 配置切点表达式 --> <aop:pointcut expression="execution(* com.atguigu.spring.aop.xml.ArithmeticCalculator.*(int, int))" id="pointcut"/> <!-- 配置切面及通知 --> <aop:aspect ref="loggingAspect" order="2"> <aop:before method="beforeMethod" pointcut-ref="pointcut"/> <aop:after method="afterMethod" pointcut-ref="pointcut"/> <aop:after-throwing method="afterThrowing" pointcut-ref="pointcut" throwing="e"/> <aop:after-returning method="afterReturning" pointcut-ref="pointcut" returning="result"/> <!-- <aop:around method="aroundMethod" pointcut-ref="pointcut"/> --> </aop:aspect> <aop:aspect ref="vlidationAspect" order="1"> <aop:before method="validateArgs" pointcut-ref="pointcut"/> </aop:aspect> </aop:config></beans>
0 0
- spring学习笔记(22)----基于配置文件的方式来配置AOP
- 20.Spring学习笔记_基于配置文件的方式来配置 AOP(by尚硅谷_佟刚)
- Spring中基于配置文件的方式来配置AOP
- 基于配置文件的方式来配置 AOP
- Spring笔记5-基于配置文件的方式配置AOP
- spring学习笔记(20)——基于配置文件方式配置AOP
- Spring4学习笔记-AOP(基于配置文件的方式)
- 15.Spring_基于配置文件的方式来配置AOP
- Spring_22_基于配置文件的方式来配置 AOP
- [学习小结]Spring_通知的那些事和基于配置文件的方式来配置AOP
- Spring-AOP:基于配置文件方式的AOP
- Spring学习笔记(四)Spring配置文件方式实现AOP
- 基于xml方式配置aop的配置文件
- Spring学习-22:Spring的AOP:基于AspectJ的XML配置方式开发
- Spring中的AOP(六)——基于XML配置文件方式的AOP
- Spring中的AOP(七)——基于XML配置文件方式的AOP
- Spring中的AOP(六)——基于XML配置文件方式的AOP
- 基于 xml 来配置 AOP -佟刚老师《Spring4视频教程》学习笔记(22)
- 配置ssh无密码访问
- 基于visual c++之windows核心编程代码分析(8)自动下载更新程序
- C#调用C++的dll两种方法(托管与非托管)
- 自己实现简单RPC功能
- 设置label的约束时遇到的小问题
- spring学习笔记(22)----基于配置文件的方式来配置AOP
- CSS-4的学习
- THINKPHP 中关联查询(多表查询)可以使用 table() 方法或和join方法
- 解决Setting property 'source' to 'org.eclipse.jst.jee.server的问题
- ListView实现多种布局
- 今天开始写博客
- 第一次以自己能力面试
- 项目问题
- 基于visual c++之windows核心编程代码分析(10)实现socket通信