hqy309
不积跬步、无以致千里!

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>

 

posted on 2013-01-29 23:20  hqy309  阅读(239)  评论(0)    收藏  举报