spring使用aop时xml中的配置
2014-11-03 13:48
369 查看
<?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" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd "> <bean id="userServer" class="com.hcj.service.impl.UserServiceImpl" init-method="init" destroy-method="destroy"> <property name="userDao" ref="userDao"></property> <!-- <constructor-arg> <ref bean="userDao"/> </constructor-arg> --> </bean> <bean id="userDao" class="com.hcj.dao.impl.UserDaoImpl"> <property name="set"> <set> <value>123</value> <value>456</value> <value>789</value> </set> </property> <property name="list"> <list> <value>a</value> <value>b</value> <value>c</value> </list> </property> <property name="map"> <map> <entry key="44" value="aa"> </entry> <entry key="55" value="bb"> </entry> </map> </property> </bean> <bean id="daoLog" class="com.hcj.log.DaoLog"></bean> <aop:config> <!-- 切入点 --> <aop:pointcut expression="execution(public void com.hcj.dao.impl.UserDaoImpl.save(..))" id="pointcut"/> <aop:aspect ref="daoLog"> <aop:before method="beforeMethod" pointcut-ref="pointcut"/> <!-- <aop:after method="afterMethod" pointcut-ref="pointcut"/> --> <aop:after-throwing method="afterMethod" pointcut-ref="pointcut"/> <!-- <aop:after-returning method="afterMethod" pointcut-ref="pointcut"/> --> </aop:aspect> </aop:config> </beans>
相关文章推荐
- Spring的AOP使用xml配置
- 使用Spring的配置xml方式实现AOP
- Spring使用AspectJ注解和XML配置实现AOP
- spring aop的使用(注解方式以及基于xml配置方式)
- spring aop的使用(注解方式以及基于xml配置方式)
- Spring学习之使用XML配置AOP
- spring使用AOP如何配置ApplicationContext.xml
- Spring中AOP使用——配置xml方式
- [5] Spring中的AOP操作(使用xml 配置文件的方式)
- 使用XML配置Spring AOP
- Spring之AOP使用xml配置更方便(使用AspectJ框架)(重点)
- 8 -- 深入使用Spring -- 4...6 AOP代理:基于注解的XML配置文件的管理方式
- Spring的AOP使用xml配置
- spring学习笔记8--使用spring进行面向切面的(AOP)编程(2)XML配置方式
- spring aop的使用(注解方式以及基于xml配置方式)
- 一步一步深入spring(6)--使用基于XML配置的spring实现的AOP
- Spring配置文件applicationContext.xml(2)之AOP
- 备忘:在web.xml中使用org.springframework.js.resource.ResourceServlet的配置对静态资源的访问
- spring使用多个xml配置文件 【转】
- spring3 混合使用 XML 与注解(Annotation)进行 Bean 的配置