Tones
Aug 13th, 2007, 09:40 PM
Hi All,
I've searched through the forums, consulted various text books and the net but have unable to determine how to set up interceptors for specifc pages in an abstractwizard controller.
Basically I have 3 pages in the wizard where I need to do some pre-processing prior to each page.
I figured I could use the formBackingObject method to do pre-processing for page 1 and then place in my pre-processing code for pages 2 and 3 into the getTargetpage method but I rather keep the pre-processing code separate from the controller as it's general things like checking for specific system vars and other properties.
My current wizard controller definition is as follows:
<bean id="wizardTestEntry"
class="sample.MyWizard">
<property name="wizardCommandBean">
<ref bean="wizardCommandBean"/>
</property>
<property name="pages">
<list>
<value>wizard1</value>
<value>wizard2</value>
<value>wizard3</value>
</list>
</property>
</bean>
And my mapping of it is:
<bean id="testUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="urlMap">
<map>
<entry key="test.wizard">
<ref bean=wizardTestEntry" />
</entry>
</map>
</property>
<property name="interceptors">
<list>
<ref bean="preWizard1"/>
</list>
</property>
</bean>
This will invoke the interceptor for each page of the wizard which is something I don't want. I want to be able to set up separate interceptors for each of the pages in the wizard. Is this possible?
Maybe interceptors are not the way to go but I couldn't think of another way since I'm using interceptors for a lot of my other controllers.
Any help would be great. Thanks!
I've searched through the forums, consulted various text books and the net but have unable to determine how to set up interceptors for specifc pages in an abstractwizard controller.
Basically I have 3 pages in the wizard where I need to do some pre-processing prior to each page.
I figured I could use the formBackingObject method to do pre-processing for page 1 and then place in my pre-processing code for pages 2 and 3 into the getTargetpage method but I rather keep the pre-processing code separate from the controller as it's general things like checking for specific system vars and other properties.
My current wizard controller definition is as follows:
<bean id="wizardTestEntry"
class="sample.MyWizard">
<property name="wizardCommandBean">
<ref bean="wizardCommandBean"/>
</property>
<property name="pages">
<list>
<value>wizard1</value>
<value>wizard2</value>
<value>wizard3</value>
</list>
</property>
</bean>
And my mapping of it is:
<bean id="testUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="urlMap">
<map>
<entry key="test.wizard">
<ref bean=wizardTestEntry" />
</entry>
</map>
</property>
<property name="interceptors">
<list>
<ref bean="preWizard1"/>
</list>
</property>
</bean>
This will invoke the interceptor for each page of the wizard which is something I don't want. I want to be able to set up separate interceptors for each of the pages in the wizard. Is this possible?
Maybe interceptors are not the way to go but I couldn't think of another way since I'm using interceptors for a lot of my other controllers.
Any help would be great. Thanks!