1. AOP 执行顺序对比
1.1 Spring4
Spring4 对应 SpringBoot 的版本就是 1.X
1.1.1 正常情况
- @Around环绕之前
- @Before
- 方法调用…
- @Around环绕之后
- @After
- @AfterReturning
1.1.2 异常情况
- @Around环绕之前
- @Before
- 方法调用…
- @After
- @AfterThrowing
1.2 Spring5
Spring5 对应 SpringBoot 的版本就是 2.X
1.2.1 正常情况
- @Around环绕之前
- @Before
- 方法调用…
- @AfterReturning
- @After
- @Around环绕之后
1.2.2 异常情况
- @Around环绕之前
- @Before
- 方法调用…
- @AfterThrowing
- @After