This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi, I am new to struts. I have a web application which basically is a redirector to other web apps. Depending upon who the user is and which app he wants to access, I (make databse calls &) generate a list of paramters (key,value) that need to be POSTed to the external app. I am doing request.setAttribute(key,value) to see these params and then do findForward. The mapping.findForward("success") launchess the other app but my parameters are not being passed. The Action() in the launched app tries to read the parameters from its ActionForm but finds nothing (I think this is because the 2 applications have different context). Please let me know if you have an idea to accomplish this POST. Thanks
If context changes then it is not possible to pass the parameters using the standard method of using the findForward. In that case you should try to sendRedirect the response to the new location sending the parameters in the qs. this has worked for me in the past. Replace your code like this: return mapping.findForward("next-location"); with response.sendRedirect("actual-new-location?param1=val1¶m2=val2"); return null; Lemme know what you think. Sahil
Joined: Sep 15, 2001
Thanks for your response. I think by using redirect, the parameter and values would get exposed in the URL (which in my case is undesirable). Please let me know if my assumption is incorrect.