1

In Spring AOP, I can add an aspect at the following locations

  • before a method executes (using MethodBeforeAdvice)
  • after a method executes (using AfterReturningAdvice)
  • around a method (both before and after a method executes) (using MethodInterceptor)

If I have all three types of advice, is the order of execution always as follows?

  • Around (before part)
  • Before
  • Method itself
  • After
  • Around (after part)
4
  • What? 15 char.. Sep 13, 2012 at 8:35
  • You'd do better searching for an answer to this on Stack Overflow; that's the place for programming questions with a simple, correct answer. Sep 13, 2012 at 8:51
  • @Donal Fellows My bad. I thought this would be more theoretical than is allowed in Stack Overflow Sep 13, 2012 at 9:41
  • Please go through the link. To understand the ordering of Spring AOP advices: ordering of Spring AOP advices
    – user72945
    Nov 18, 2012 at 8:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.