<?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.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <!-- bean definitions here --> <aop:aspectj-autoproxy/> <bean id="custmoer" class="com.snow.demo8.CustomerDaoImpl"/> <bean id="myAspectXml" class="snow.imooc.demo8.MyAspectXml"/> <aop:config> <aop:pointcut id="pointcut1" expression="execution(* com.snow.demo8.CustomerDao.delete(..))"/> <aop:pointcut id="pointcut2" expression="execution(* com.snow.demo8.CustomerDao.delete(..))"/> <aop:aspect ref="myAspectXml"> <aop:before method="before" pointcut-ref="pointcut1"/> <aop:after-returning method="after" pointcut-ref="pointcut2" returning="result"/> <aop:around method="around" pointcut-ref="pointcut2"/> <aop:after-throwing method="afterThrowing" pointcut-ref="pointcut2"/> <aop:after method="afterFinal" pointcut-ref="pointcut2"/> </aop:aspect> </aop:config> </beans>
AspectJ注解各类型通知
猜你喜欢
转载自blog.csdn.net/qq_27248989/article/details/103992405
今日推荐
周排行