Wednesday, August 7, 2013

Struts forward parameters to URL in action class

In some cases, you have to send additional parameters with the action forwarding.
Following code snip can be used to set additional parameters in the action class of the struts. 

ActionRedirect redirect = new ActionRedirect(mapping.findForward(forwardPage)); 
redirect.addParameter("username", "user"); 

redirect.addParameter("password", "PWD");
return redirect;