【场景描述】
为接口添加监控,配置<aop:aspectj-autoproxy expose-proxy="true">后代理不生效
【原因分析】
SpringMVC AOP无效不起作用解决方法
其中加载spring主配置文件的是applicationContext,加载springmvc的是webApplicationContext。
如果我们要切入Controller,需要在webmvc的配置文件里添加<aop:aspectj-autoproxy expose-proxy="true">
如果我们要切入其他Service,需要在主配置文件里添加<aop:aspectj-autoproxy expose-proxy="true">
如果两个都需要切入,那么两个配置文件都需要添加AOP配置

相关文章:

  • 2021-12-16
  • 2021-05-24
  • 2021-12-19
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
猜你喜欢
  • 2021-04-30
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2021-09-20
相关资源
相似解决方案