感谢ITCAST发布的免费视频
基于XML配置方式声明切面
<bean id=”orderservice” class=”cn.service.OrderServiceBean” />
<bean id=”log” class=”cn.service.LogPrint” />
<aop:config>
<aop:aspect id=”myaop” ref=”log”>
<aop:pointcut id=”mycut” expression=”execution(* cn.service..*.*(..))”/>
<aop:before pointcut-ref=”mycut” method=”doAccessCheck” />
<aop:after-returning pointcut-ref=”mycut” method=”doReturnCheck” />
<aop:after-throwing pointcut-ref=”mycut” method=”doExceptionAction” />
<aop:after pointcut-ref=”mycut” method=”doReleaseAction” />
<aop:around pointcut-ref=”mycut” method=”doBasicProfiling” />
</aop:aspect>
</aop:config>