• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to POST parameters to external app

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Monty Guppy
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic