aop配置

来源:互联网 发布:360文件加密软件 编辑:程序博客网 时间:2024/06/11 08:12
<?xml version="1.0" encoding="UTF-8"?><beansxmlns="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.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"><bean id="dao" class="cn.veryedu.dao.impl.AccountsTabDAOImpl"></bean><bean id="service" class="cn.veryedu.service.impl.AccountsTabServiceImpl"><property name="dao"><ref local="dao"/></property><property name="manager"><ref local="manager"/></property></bean> <bean id="action" class="cn.veryedu.action.AccountAction" abstract="true"><property name="service"><ref local="service"/></property></bean><bean id="manager" class="cn.veryedu.transaction.TransactionManager"></bean><bean name="/queryAccount" parent="action"></bean><bean name="/modifyAccount" parent="action"></bean><bean id="logAdvice" class="cn.veryedu.advice.LogAdvice"/><aop:config><aop:pointcut id="logPointcut" expression="execution(* cn.veryedu.service.*.modify*(..))"/><aop:pointcut id="logPointcut2" expression="execution(* cn.veryedu.service.*.query*(..))"/><!-- 定义一个可以被使用的切面 <aop:aspect id="logAspect" ref="logAdvice"><aop:before method="printLog" pointcut-ref="logPointcut"/></aop:aspect>--><aop:aspect id="logAspect" ref="logAdvice"><aop:before method="printLog" pointcut-ref="logPointcut2"/></aop:aspect></aop:config></beans>

原创粉丝点击