We have 2 separate tomcat instances running on different physical servers. I want to call servlet A on server 1 from servlet b on server 2.
Please help. I need to pass the same request and response parameters which i have recived in servlet b. i.e. I want to forward a request . I guess the requestdispatcher will not work as it's different jvm and web.xml.
Bear Bibeault wrote:You'll need to make an HTTP request to the remote servlet.
You can use the classes in the java.net package, or use a higher-level API such as HttpClient.
Thanks for the response. How do I set the same httpRequest and HttpResponse when i call the other servlet using apache HTTPClient. I need to forward the request.
Bear Bibeault wrote:
Dev Lakhani wrote:How do I set the same httpRequest and HttpResponse when i call the other servlet using apache HTTPClient. I need to forward the request.
You don't, and you can't. You need to make a separate request tot he remote server.
Ok, But the HttpRequest which I get has a lot of information in it. I recieve it in via doPost. I want to send all that info as it is to the other servlet. Please help. Thanks.