PDA

View Full Version : Multiple Interceptor



AabhaVarma
Jan 11th, 2009, 05:24 PM
Hi

I am a newbie to spring.
The xml file for configuration is
<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
,.....

<property name="interceptors">
<list>
<ref bean="commonInfoInterceptor" />
<ref bean="TypoInterceptor" />
</list>
</property>

these are being referred to a bean that extends
HandlerInterceptorAdapter
The problem is, only one interceptor is being invoked.
I may be missing some configuration. could anyone direct me to where to debug

Cyril.Deba
Jan 12th, 2009, 04:13 AM
Hi

I am a newbie to spring.
The xml file for configuration is
<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
,.....

<property name="interceptors">
<list>
<ref bean="commonInfoInterceptor" />
<ref bean="TypoInterceptor" />
</list>
</property>

these are being referred to a bean that extends
HandlerInterceptorAdapter
The problem is, only one interceptor is being invoked.
I may be missing some configuration. could anyone direct me to where to debug

try something like this:



<bean id="simpleUrlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="order">
<value>0</value>
</property>
<property name="mappings">
<props>
<prop key="/welcome">welcomeController</prop>
<prop key="/home">homeController</prop>
</props>
</property>
<property name="interceptors">
<list>
<ref bean="firstInterceptor" />
<ref bean="secondInterceptor" />
<ref bean="thirdInterceptor" />

</list>
</property>
</bean>



it should be work