asears
Feb 21st, 2005, 10:43 AM
Is it possible to set attributes in one controller, and retreive the attributes in the next controller?
Controller A is extended from a SimpleFormController, and in the onSubmit(), I use the request.setAttribute("name", "value"). The return statement:
return new ModelAndView( new RedirectView(this.getSuccessView()), modelMap );
Controller B is extended from a ParameterizableViewController, and in the handleRequestInternal(), the request.getAttribute("name") returns a null.
the part of the servlet mapping xml file looks like this:
<bean id="controllerA" class="com.blah.example.controllerA">
<property name="formView">
<value>controllerA</value>
</property>
<property name="successView">
<value>controllerB</value>
</property>
<property name="sessionForm">
<value>true</value>
</property>
</bean>
<bean id="controllerB" class="com.blah.example.controllerB">
<property name="viewName">
<value>controllerB</value>
</property>
</bean>
The purpose of this is so that the parameter does not have to be displayed in the URL.
Controller A is extended from a SimpleFormController, and in the onSubmit(), I use the request.setAttribute("name", "value"). The return statement:
return new ModelAndView( new RedirectView(this.getSuccessView()), modelMap );
Controller B is extended from a ParameterizableViewController, and in the handleRequestInternal(), the request.getAttribute("name") returns a null.
the part of the servlet mapping xml file looks like this:
<bean id="controllerA" class="com.blah.example.controllerA">
<property name="formView">
<value>controllerA</value>
</property>
<property name="successView">
<value>controllerB</value>
</property>
<property name="sessionForm">
<value>true</value>
</property>
</bean>
<bean id="controllerB" class="com.blah.example.controllerB">
<property name="viewName">
<value>controllerB</value>
</property>
</bean>
The purpose of this is so that the parameter does not have to be displayed in the URL.