开发者社区> 问答> 正文

spring aop 配置问题,高手求助403.10 禁止访问:配置无效 

先上代码,

<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的请求,但是现在有两个类不希望被监控到,谁能帮个忙?

展开
收起
kun坤 2020-05-27 21:27:42 615 0
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> ######回复 @巴拉巴拉卟 : 这样所有的DAO操作都不会在控制内了?我是想只把其中的一个DAO操作剔除,目前的做法是用目录控制,想知道在aop配置中能不能去掉######没试过, 你可以试试看.
    2020-05-28 14:47:05
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载

相关实验场景

更多