Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 31-08-2012 11:42, Léa Massiot skrev:
(Warning: there is some "raw text" in this post.)

Hello Casper. Hello list.
Thank you for your answer and your advices.

Here is some interesting litterature related to my problem:
       "Redirecting from a servlet to an exterior URL using a POST"
http://www.mail-archive.com/servlet-interest@java.sun.com/msg49110.html
Well as they say in that thread POST is not any more secure than showing the parameters in the querystring (using GET) so no real reason for using POST for that :)

Which led me to write a programmatic POST using this code:
       "How to use HttpURLConnection POST data to web server?"
http://www.xyzws.com/Javafaq/how-to-use-httpurlconnection-post-data-to-web-server/139

And, in "SERVLET_2", I replaced the code (see my first post in this thread)
with this one:
You could also do it the other way around. Make F1 from Server1 POST to J1.jsp (still on Server1), which then makes a similar POST request (with the parameters necessary from F1) to Servlet_2, reads the result ("ok") from the response coming from Servlet_2 and then display the right thing in J1.jsp. That would be cleaner than letting the user shift from Server1/app1 to Server2/app2 for good (where is the user supposed to continue the browsing/work App1 (Server1) or App2(Server2)?)

I guess my thread's title is not really relevant anymore because this code
doesn't literally "pass" an object from one webapp to another running on two
different servers...
What I'm doing here is "redirecting from a servlet to an exterior URL using
a POST".
I'm not really displaying "something user specific / session specific" but
Casper's comments are very interesting and may prove useful in the future
for me.
My comments and suggestions are certainly relevant if one is trying to accomplish something that needs to be secure (the user can't manipulate the parameters/results to gain unauthorized access or escape payment but still receive an item).

Thanks again :)
Best regards.



--
View this message in context: 
http://tomcat.10.n6.nabble.com/Pass-an-object-from-one-Webapp-to-another-on-two-differents-servers-tp4985870p4986091.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to