aop低版本方法内调用方法捕获不到的解决办法
# aop低版本方法内调用方法捕获不到的解决办法
可以解决我们的问题,这时候你一定认为事情可以大功告成了,但是真正的坑来了:我们的spring-boot版本是1.3.5,版本过低,这种注解必须是高版本才能支持,有种想死的感觉。。。。怎么办?
还是想想csdn上的那篇文章,通过配置文件是可以解决的,那么我们就在spring boot中导入配置文件应该就没问题了啊。
于是我们可以配置一个aop.xml文件,文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>
</beans>
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
然后在ApplicationMain中添加注解如下:
@ImportResource(locations = "aop.xml")
1
编辑 (opens new window)
上次更新: 2024/01/26, 05:03:22
- 01
- python使用生成器读取大文件-500g09-24
- 02
- Windows环境下 Docker Desktop 安装 Nginx04-10
- 03
- 使用nginx部署多个前端项目(三种方式)04-10