I want to apply logging advice to Struts Action classes. Specifically I want to apply logging when the Struts Action class throws an exception.
I have integrated the Struts with Spring using the ContextLoaderPlugin in the struts-config.xml as :
<set-property property="contextConfigLocation" value="/WEB-INF/spring-test.xml"/>
My struts-config.xml contains the following action mapping:
<forward name="success" path="/index.jsp" />
My spring config file has following reference:
Everything works fine and struts is integrated perfectly but If i try to intercept the above struts action to put in a logging advice for exceptions it says that class has to be a struts action. Is this a limitation as far as struts can go with spring such that no advices can be applied to struts action classes ?
Another way around this is purely to use struts exception handler declared in the struts config file but in that case I am not able to get the action class name which actually throws the excpetion for logging purposes. Thats why I was looking at applying spring advices to struts action classes.
Any direction in this issue will be greatly appreciated.