You should be able to use Spring 1.2 AOP. You create a MethodInterceptor and hook it with a ProxyFactoryBean. Here is some sample configuration:
Code:
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/**">myController</prop>
</props>
</property>
</bean>
<bean id="myController" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>org.springframework.web.servlet.mvc.Controller</value>
</property>
<property name="interceptorNames">
<list>
<value>myInterceptor</value>
</list>
</property>
<property name="target">
<bean class="com.mycompany.MyMultiActionController"/>
</property>
</bean>
<bean id="myInterceptor" class="com.mycompany.MyInterceptor"/>
And the interceptor class:
Code:
public class MyInterceptor implements org.aopalliance.intercept.MethodInterceptor {
public Object invoke(MethodInvocation invocation) throws Throwable {
// perform security check
return invocation.proceed();
}
}
Rossen