标签:art method span work ota except com XML data-
配置文件与注解方式的有很大不同,多了很多配置项。
beans2.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:context="http://www.springframework.org/schema/context"
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/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<aop:aspectj-autoproxy />
<bean id="personService" class="test.spring.service.impl.PersonServiceBean"></bean>
<bean id="myInterceptor" class="test.spring.aop.MyInterceptor2"></bean>
<aop:config>
<aop:aspect id="myAspect" ref="myInterceptor">
<aop:pointcut id="myPointCut" expression="execution(* test.spring.service.impl.PersonServiceBean.*(..))" />
<aop:before pointcut-ref="myPointCut" method="doAccessCheck" />
<aop:after-returning pointcut-ref="myPointCut" method="doAfterReturning" />
<aop:after-throwing pointcut-ref="myPointCut" method="doAfterThrowing" />
<aop:around pointcut-ref="myPointCut" method="doAround" />
<aop:after pointcut-ref="myPointCut" method="doAfter" />
</aop:aspect>
</aop:config>
</beans>
切面的切入点语法定义
标签:art method span work ota except com XML data-
原文地址:http://www.cnblogs.com/hoobey/p/6106272.html