首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > 云计算 >

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

2013-03-12 
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>

热点排行