AOP实现方式二

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>
posted @ 2021-10-26 09:56  蘑菇王国大聪明  阅读(24)  评论(0)    收藏  举报