1、Spring 1.X中使用的传统方式
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--CONFIG-->
<bean id="aopTest1"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>org.readyesb.web.services.dataprovider.interfaces.DataProvider</value>
</property>
<property name="target">
<ref local="beanTarget" />
</property>
<property name="interceptorNames">
<list>
<value>theAdvisor</value>
</list>
</property>
</bean>

<!--CLASS-->
<bean id="beanTarget" class="org.readyesb.web.services.dataprovider.impl.DataProviderImpl"/>

<!--ADVISOR-->
<!--Note: An advisor assembles pointcut and advice-->
<bean id="theAdvisor"
class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref local="theThrowAdvice" />
</property>
<property name="patterns">
<value>.*org.readyesb.web.services.dataprovider.interfaces.DataProvider.*</value>
</property>
</bean>

<!--ADVICE-->
<bean id="theThrowAdvice"
class="org.readyesb.exception.FaultException" />
</beans>
2、Spring 2.X Schema-based AOP support
<?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.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

<aop:config>
<aop:aspect id="aopTestId" ref="aopTestException">
<aop:pointcut id="theExceptionAopTestMethod" expression="execution(* org.readyesb.web.services.dataprovider.impl.DataProviderImpl.*(..))"/>
<aop:after-throwing pointcut-ref="theExceptionAopTestMethod" method="afterThrowing"/>
</aop:aspect>
</aop:config>
<bean id="aopTestException" class="org.readyesb.exception.FaultException"/>
</beans>
3、Spring 2.X Schema-based AOP support - Advisors
<?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.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

<aop:config>
<aop:advisor id="aopTest" advice-ref="aopTestException" pointcut="execution(* org.readyesb.web.services.dataprovider.impl.DataProviderImpl.*(..))"/>
</aop:config>
<bean id="aopTestException" class="org.readyesb.exception.FaultException"/>
</beans>







































2、Spring 2.X Schema-based AOP support
















3、Spring 2.X Schema-based AOP support - Advisors












