这个例子中没有用到<aop:advisor> 吧??求讲解

来源:5-7 Advisors

qq_Disorganized_04359428

2017-03-08 09:30

这个例子中没有用到

吧???求讲解
写回答 关注

2回答

  • geYang
    2018-01-25 14:15:33

    <!-- 事务注解:开启注解支持-->

        <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>

        

        <!-- 全局AOP事物,除get,list,select,query开头的方法外,都处在事物当中  -->

    <tx:advice id="txAdvice" transaction-manager="transactionManager">

    <tx:attributes>

    <tx:method name="select*" propagation="REQUIRED" read-only="true" />

    <tx:method name="get*" propagation="REQUIRED" read-only="true" />

    <tx:method name="list*" propagation="REQUIRED" read-only="true" />

    <tx:method name="query*" propagation="REQUIRED" read-only="true" />

    <tx:method name="*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception"/>

    </tx:attributes>

    </tx:advice>

    <!-- 配置事务切面 到Service层 -->

    <aop:config expose-proxy="true" proxy-target-class="true" >

    <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.xt.shop.base.service..*.*(..))"/>

    </aop:config>


  • Blegend
    2017-03-12 11:57:37

    是没有讲到,你可以参照一下这个博客里面的内容http://tonl.iteye.com/blog/1966075;

Spring入门篇

为您带来IOC和AOP的基本概念及用法,为后续高级课程学习打下基础

268791 学习 · 963 问题

查看课程

相似问题