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>
浙公网安备 33010602011771号