<aop:pointcut expression="execution(* com.tfy.aop.exception.ClassesServi

aop:pointcut expressionexecution(* com.tfy.aop.exception.ClassesServiceImpl.*(..)) idperform

<aop:pointcut expression="execution(* com.tfy.aop.exception.ClassesServiceImpl.*(..))" id="perform"
<?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="classesDao" class="com.tfy.aop.exception.ClassesDaoImpl">
</bean>
<bean id="classesService" class="com.tfy.aop.exception.ClassesServiceImpl">
<property name="classesDao">
<ref bean="classesDao"/>
</property>
</bean>
<bean id="classesAction" class="com.tfy.aop.exception.ClassesAction">
<property name="classesService">
<ref bean="classesService"/>
</property>
</bean>
<bean id="myException" class="com.tfy.aop.exception.MyException"></bean>


<!-- 
切入点表达式的作用就是找到目标类
-->
 
<aop:config>
 
<aop:pointcut expression="execution(* com.tfy.aop.exception.ClassesServiceImpl.*(..))" id="perform"/>
<aop:aspect ref="myException">
<aop:after-throwing method="myException" pointcut-ref="perform" throwing="ex"/>
</aop:aspect>
</aop:config>
</beans>