It's not a secret anymore!
The moose likes Struts and the fly likes Struts2 with Spring AOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 with Spring AOP" Watch "Struts2 with Spring AOP" New topic

Struts2 with Spring AOP

vishwa venkat
Ranch Hand

Joined: Nov 22, 2003
Posts: 185
Is this possible?

I have tried several ways to integrate spring AOP with Struts2, with no luck. AutoProxy doesn't seem work well too. Can you guys suggest some ideas?


David Newton

Joined: Sep 29, 2008
Posts: 12617

You need to use cglib proxies.
vishwa venkat
Ranch Hand

Joined: Nov 22, 2003
Posts: 185
Thanks for the reply.

I got cglib and asm in my classpath and here is the snippet from applicationContext.xml

<!-- A simple MethodInterceptor style advice object (InterceptorA implements MethodInterceptor) -->
<bean id="loggingAspect" class="aspects.LoggingAspect"/>

<bean name="pointcut.advisor2" class="">
<property name="advice" ref="loggingAspect"/>
<property name="mappedName" value="*"/>

<!-- Create the proxy bean that returns AOP'd varieties of our controller -->
<bean name="myController" class="org.springframework.aop.framework.ProxyFactoryBean">

<property name="target" ref="claimService" />
<property name="interceptorNames">


After all this, I don't see any error, but also I don't see any thing happening.Aspect is not being executed.

Do you have a sample? Thanks-
I agree. Here's the link:
subject: Struts2 with Spring AOP
It's not a secret anymore!