Declaring advices:-There are five types of Advices as follows
1.before advice- <aop:before></aop:before >
2.after-returning advice- <aop:after-returning></aop:after-returning>
3.after-throwing advice- <aop:after-throwing></aop:after-throwing>
4.after advice- <aop:after></aop:after>
5.around advice- <aop:around></aop:around>
1 Before advice:
You can declare any of the five advices inside an <aop:aspect>...</aop:aspect>
using the <aop: name="name">...</aop:>element as given below:
Before advice runs before a matched method execution. It is declared inside an <aop:aspect>
using the <aop:before> element.
<aop:aspect id="beforeExample" ref="loginAspect">
<aop:before pointcut-ref="businessService"
method="logRequiredTask">
...
</aop:before>
</aop:aspect>