-
Feb 25th, 2006, 03:14 PM
#1
Around Advice and RegexpMethodPointcutAdvisor
I am trying to intercept struts action methods using an Around Advice.
public class ActionInterceptor extends DelegatingIntroductionInterceptor {
public Object invoke(MethodInvocation methodInvocation) {
...
return methodInvocation.proceed();
}
}
<!-- Method 1 This is not working -->
<bean id="actionAutoProxy"
class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
<property name="pattern">
<value>.*do.*</value>
</property>
<property name="advice">
<ref bean="actionInterceptor"/>
</property>
</bean>
<!-- Method 2 This is working -->
<bean id="actionAutoProxy"
class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
<property name="beanNames">
<value>/login</value>
</property>
<property name="interceptorNames">
<list>
<value>actionInterceptor</value>
</list>
</property>
</bean>
Here the Method 2 works but not the Method 2. Do we need to use a different class anywhere here ?
Any help appreciated.
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