applicationContext.xml
<!--方法二 自定义类-->
<bean id="diyPointCut" class="com.shao.diy.DiyPointCut"/>
<aop:config>
<aop:aspect ref="diyPointCut" >
<!--切入点-->
<aop:pointcut id="point" expression="execution(* com.shao.service.UserServiceImpl.*(..))"/>
<!--通知-->
<aop:before method="before" pointcut-ref="point"/>
<aop:after method="after" pointcut-ref="point"/>
</aop:aspect>
</aop:config>