I am redirecting from a controller to another controller. But I also need to pass model attributes to the second controller.
I don't want to put the model in session.
Please help.
I think that the most elegant way to do it is to implement custom Flash Scope in Spring MVC.
the main idea for the flash scope is to store data from one controller till next redirect in second controller
Please refer to my answer on the custom scope question:
The only thing that is missing in this code is the following xml configuration:
<bean id="flashScopeInterceptor" class="com.vanilla.springMVC.scope.FlashScopeInterceptor" />
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<list><ref bean="flashScopeInterceptor"/></list>
</property>
</bean>