-
Jul 3rd, 2012, 04:23 AM
#1
Spring AOP configuration in a Spring web application
Hi,
I want to configure logging using Spring AOP in a Spring web application. I have several controllers and I want to implement it in one of the controller classes. The definition for the controller class in the servelet.xml is as follows:
This is the definition for the controller:
<bean id="aboutYouFormController"
class="com.hx.hd.controller.AboutYouFormController ">
<property name="sessionForm">
<value>true</value>
</property>
<property name="commandName">
<value>screen</value>
</property>
<property name="commandClass">
<value>com.hx.hd.beans.HouseholdBean</value>
</property>
<!--<property name="validator"><ref bean="beanValidator"/></property>-->
<property name="validator"><ref bean="aboutYouValidator" /></property>
<property name="aboutYouServiceBroker"
ref="aboutYouServiceBroker" />
<property name="formView">
<value>AboutYou</value>
</property>
<property name="successView">
<value>YourHome</value>
</property>
</bean>
This is the configuration for the AOP:
<bean id="loggingAdvice" class="com.hx.hd.logger.AboutYouLogger" />
<aop:aspectj-autoproxy />
<aop:config>
<aop
ointcut id="loggingPointcut"
expression="execution(* com.hx.hd.controller.AboutYouFormController.*(..)) " />
<aop:advisor advice-ref="loggingAdvice" pointcut-ref="loggingPointcut"
id="loggingInterceptorAdvisor" />
</aop:config>
The problem i am facing is that the logging is not happening . The aop configuration is never recognised. I have tested the same in a standalone app and it works.
Please throw some insight on this..
thanks in advance..
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules