<aop:config>
<!-- 声明一个切面 -->
<aop:aspect id="testAspect" ref="serviceAspect">
<!-- 配置一个切入点 -->
<aop:pointcut expression="execution(* com.skss.portal.service..*(..))" id="myPointcut"/>
<!-- 配置通知 -->
<aop:before pointcut-ref="myPointcut" method="before"/>
<aop:after pointcut-ref="myPointcut" method="after"/>
<aop:after-throwing pointcut-ref="myPointcut" method="afterThrowing"/>
</aop:aspect>
</aop:config>
<!-- 声明一个切面 -->
<aop:aspect id="testAspect" ref="serviceAspect">
<!-- 配置一个切入点 -->
<aop:pointcut expression="execution(* com.skss.portal.service..*(..))" id="myPointcut"/>
<!-- 配置通知 -->
<aop:before pointcut-ref="myPointcut" method="before"/>
<aop:after pointcut-ref="myPointcut" method="after"/>
<aop:after-throwing pointcut-ref="myPointcut" method="afterThrowing"/>
</aop:aspect>
</aop:config>
本文详细介绍了如何使用AOP进行切面配置,包括声明切面、配置切入点及各种通知方式,如前置通知、后置通知及异常通知等。
1012

被折叠的 条评论
为什么被折叠?



