I have written one servlet from which I want to pass the objects created in it to a servlet on another server. I have tried it with the sendRedirect method. It is working fine for simple strings when appended with the url query string, but how can I send bulk amount of data with the request and also have a response from there? I have also tried using forward method, but it doesnt work for remote contexts even if a reference to remote context is acquired.
A forward stays on the server and is part of the same request. So you can store data as an attribute and forward. If you need to redirect to a Servlet that is part of another application on another box, redirect is always a GET reuest so the URL string is all you have.
Roland Barcia<br />STSM - ISSW Lead Web 2.0 Architect
Ashish Agrawal
Ranch Hand
Joined: Nov 02, 2003
Posts: 112
posted
0
Originally posted by Roland Barcia: A forward stays on the server and is part of the same request. So you can store data as an attribute and forward. If you need to redirect to a Servlet that is part of another application on another box, redirect is always a GET reuest so the URL string is all you have.
Thats right...but as I mentioned in my post, I want to send objects and not just character data. Is there any other way like using URLConnection,etc.? If yes, how? - Ashish Agrawal.
Here is some quick and dirty JSP to demonstrate. Put both files in the same directory. ------------sender.jsp---------------------------------------- -------------------------------bouncer.jsp--------------------------
Ashish Agrawal
Ranch Hand
Joined: Nov 02, 2003
Posts: 112
posted
0
Thank you very much Rick
subject: Forwarding a request to a sevlet inside context on another web server.