您的位置:首页 > 编程语言 > Java开发

spring aop xml

2013-01-29 23:20 225 查看
applicationContext.xml

<?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-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> 
<bean id="personDao" class="aop.xml.PersonDaoImpl" />

<bean id="transaction" class="aop.xml.Transaction" />

<aop:config>
<aop:pointcut expression="execution(* aop.xml.PersonDaoImpl.*(..))"
id="perform" />
<aop:aspect ref="transaction">
<aop:before pointcut-ref="perform" method="beginTransaction" />
<aop:after-returning pointcut-ref="perform"
method="commit" returning="" />
</aop:aspect>
</aop:config>

</beans>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: