开发者社区 问答 正文

spring aop 配置问题出现了问题,求助

先上代码,

<aop:config>
   <aop:pointcut id="profileAudit" expression="execution(* com..*ServiceImpl.*(..)) or execution(* com..*DaoImpl.*(..))" />
   <aop:aspect ref="profileAdvice" order="5">
      <aop:before pointcut-ref="profileAudit" method="beforeExecute" />
      <aop:after pointcut-ref="profileAudit" method="afterExecute" />
   </aop:aspect>
</aop:config>

这个配置可以监控所有的service、dao的请求,但是现在有两个类不希望被监控到,谁能帮个忙?

展开
收起
小旋风柴进 2016-03-03 16:26:42 2380 分享 版权
1 条回答
写回答
取消 提交回答
  • <aop:config>
       <aop:pointcutid="profileAudit"expression="execution(* com..*ServiceImpl.*(..)) or !execution(* com..*DaoImpl.xxx(..))"/>
       <aop:aspectref="profileAdvice"order="5">
          <aop:beforepointcut-ref="profileAudit"method="beforeExecute"/>
          <aop:afterpointcut-ref="profileAudit"method="afterExecute"/>
       </aop:aspect>
    </aop:config>
    2019-07-17 18:51:37
    赞同 展开评论