Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing dynamic parameter in redirect

 
R .sourav nayak
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
could some one send me some example how to pass dynamic parameter in redirect.

hoping some one to answer this
thanks
 
robert isidorson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example :
ActionForward forward = new ActionForward("/youraction.do?id="+id,);
forward.setRedirect(true);
return forward;

You can also check out the ActionRedirect class in the documentation.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A "feature" of Struts is that an ActionForward returned from findForward cannot be modified. Below is a utility method that I put together a while back to make it easy to add a dynamic parameter to an ActionForward.



- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic