zoukankan      html  css  js  c++  java
  • spring aop expression支持多个表达式配置

    <!-- 配置那些类的方法进行事务管理 --> 
    <aop:config> 
    <aop:pointcut id="allServiceMethod" expression="execution (* com.cms.sys.service.*.*(..))" /> 
    <aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" /> 
    </aop:config> 

    还有一个 execution (* com.cms.art.service.*.*(..))" 要怎么写? 

    可以这样写:将execution分开写。 

    <aop:config> 
    <aop:pointcut id="allServiceMethod" expression="(execution (* com.cms.sys.service.*.*(..))) or (execution (* com.cms.art.service.*.*(..)))" /> 
    <aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" /> 
    </aop:config> 

    老外喜欢把逻辑运算符用or,and 写,国内一般用|| && !。 

  • 相关阅读:
    「codeforces
    「sdoi2019
    「ABC 218」解集
    「hdu
    「atcoder
    「tricks」平凡二分幻术
    并查集
    Bellman-Ford算法 & SPFA & SPFA_DFS
    最近公共祖先(LCA)
    题解 P5751 【[NOI1999]01串】
  • 原文地址:https://www.cnblogs.com/henuyuxiang/p/6674364.html
Copyright © 2011-2022 走看看