zoukankan      html  css  js  c++  java
  • 同类型的aop:aspect谁先执行

    spring对于同类型aspect谁先执行是不确定的,但是可以通过order属性设置数值,数值小的会优先执行

    <aop:config>
            <aop:pointcut id="studentPointcut" expression="execution(* com.target.StudentDaoImpl.*(..))"/>
             <!--第一个-->
            <aop:aspect ref="log" order="2">
                <aop:around method="aroundInsert" pointcut-ref="studentPointcut"/>
            </aop:aspect>
             <!--第二个-->
            <aop:aspect ref="log" order="4">
                <aop:around method="aroundInsert2" pointcut-ref="studentPointcut"/>
            </aop:aspect>
    </aop:config>

    proxy-target-class

    得到实现类,调用实现类的方法,而不是接口,调用接口的方法,需要使用cglib代理创建aop代理对象,在aop:config中的属性 proxy-target-class设置为true即可。

    <aop:config proxy-target-class="true">
    </aop:config>
  • 相关阅读:
    hdu 1058
    hdu 1003
    hdu 1500
    hdu 1083 最大匹配
    hdu 1370 中国剩余定理
    hdu 1299 数论 分解素因子
    hdu 1299
    poj 1144 求割点
    hdu 1068 最大独立集合
    hdu 1054
  • 原文地址:https://www.cnblogs.com/liweixml/p/11789112.html
Copyright © 2011-2022 走看看