How do we configure annotation based spring aspect in java?
Lets say we want to intercept a spring service, we usually do it by AOP pointcut expression. This example details how to do it using annotation instead of expression. This is more portable as we use annotation.
There are many examples but very few have the right content. Hence putting it here…
This is a solved question. I am posting my answer so it helps others including myself..
Annotation based AOP advice in spring
1.define annotation
Set
<aop:aspectj-autoproxy />in spring config file if not done before2.
3.Apply annotation on service which needs to be intercepted