Declaring advices by R4R Team

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>

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!