Declaring an aspect by R4R Team

Declaring an aspect:-
Using the schema support, an aspect is simply a regular Java object defined as a bean in your Spring application context. The state and behavior is captured in the fields and methods of the object, and the pointcut and advice information is captured in the XML.

Declaring an aspect An aspect is declared using the <aop:aspect> element, and the backing bean is referenced using the ref attribute as follows:
 

<aop:config>

<aop:aspect id="loginAspect"  ref="loginAspect">

...

</aop:aspect>

</aop:config>

<bean id="loginAspect" class="com.r4r.in.Register.loginAspect">

...

</bean>

Here "LoginAspect" will be configured and dependency injected just like any other Spring bean.

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!