spring aop的主要注解 @Before @After @AfterReturning @AfterThrowing @Around 的执行顺序是什么?
spring版本不同,执行顺序也不同,这里讨论spring4和spring5
spring4,@After在@AfterReturning或@AfterThrowing前面
spring5,@After在@AfterReturning或@AfterThrowing后面
spring4的正常顺序, @Around环绕通知将@Before包裹起来,之后是@After和@AfterReturning
spring5的正常顺序, @Around环绕通知将@Before、@AfterReturning和@After包裹起来
异常顺序, @Around环绕通知执行了一半,proceedingJoinPoint.proceed()方法之后不会执行