0

I am newbie to spring3.I learned spring from struts2.In struts2 i have used chain for passing the request parameter value to one action to another.

<action name="some" class="com.hello">
<result name="success" type="chain">world</result>
</action>
<action name="world" class="com.world">
<result name="success">helloworld.jsp</result>
</action>

How to achieve the equivalent thing in spring3?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Selva
  • 1,620
  • 3
  • 33
  • 63
  • 2
    Usage of `chain` result is discouraged. – Aleksandr M Sep 09 '15 at 08:56
  • @Alexsandr,My requirement is to add user to database and redirect to another page with success message.Using redirect i can't able to pass it. – Selva Sep 09 '15 at 08:58
  • 3
    Yes you can... Have you read [the documentation](http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/mvc.html#mvc-redirecting-passing-data) and about [flash attribute](http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/mvc.html#mvc-flash-attributes)? – M. Deinum Sep 09 '15 at 09:06
  • @Madhesh Chaining is almost *never* necessary in S2; I'd consider taking a different approach like flash (which is just specialized session use), re-retrieving (if it's DB info, which should be handled by your caching layer anyway), or just about anything else other than chaining. – Dave Newton Sep 09 '15 at 13:57
  • related http://stackoverflow.com/questions/13247239/spring-mvc-controller-redirect-without-parameters-being-added-to-my-url/13247358#13247358 – Andrea Ligios Sep 10 '15 at 07:56
  • @Deinum,Thanks Flashmap is did the magic.please post your comment as answer. – Selva Sep 10 '15 at 12:03

0 Answers0