I am having a wierd issue with struts2 and aop. I need to intercept certain struts2 actions for checking some custom settings. The actions are getting intercepted but it breaks all page parameters/form values etc:
The AOP configuration is:
<aop:advisor id="associateModuleCheck" advice-ref="associateModuleAdvice" pointcut="execution(* uk.co.company.package.webapp.action.*.ModuleA*.*(..))" order="1"/>
And the method Interceptor
public Object invoke(MethodInvocation invocation) throws Throwable {
Class<?> targetClass = invocation.getThis().getClass();
// DO stuff
return invocation.proceed();
}
Basically I can see that the action methods are intercepted, but when it's returned to the page, it breaks all form values. (Some actions won't even reach the MethodInterceptor method but I can see from the Spring log that it's basically intercepted) :
Candidate is: '/namespacebbb/ModuleAction/method.action'; pattern is /**; matched=true
The reason why I am not using Struts2 interceptor is because I can configure a whole lot of actions in one go using Spring AOP.
If I remove the interceptor everything works fine. Anybody done this stuff before? Any idea what's wrong?
Update:
Though I finally ended up using a struts2 interceptor, this issue is still open. I found this spring forum question, which is very similar to my issue:
http://forum.spring.io/forum/spring-projects/aop/38625-aop-struts-2-help