Greetings !! hope you all doing great with your kith and kin.
I have a new problem(not actually a problem but something new to learn about ) ,i am doing some manipulations with one servlet ,say
ServletOne, now i have ServletTwo on different tomcat server.
now i want to send a request from ServletOne to ServletTwo and want a response back from ServletTwo to ServletOne.
what is best way to achieve it. I am using URL CLass for this.but i want to send response back from ServletTwo to ServletOne with some values. will sendRedirect will help in this,in case i need some values with it.
olivier dutranoit wrote:here is a quick and dirty example :
Thank you so much for quick responses,
The problem is that we are trying to implement browser re-direction without a browser, which is not a good idea. In order to invoke the servletTwo on other server , we need to work with help of browser redirections at this phase.
Its like there are three different server, server1 is requestor server from where all the incoming request will come to server2 which is the main server where all the request validations are taken care of. my situation is while validating that request means in between the code i need to reach to server 3 ,collect the response from there and again return to server 1.
this is the whole scenario. how can implement browser redirection in between java code.
Please suggest, and moreover thanks for the time to read the post.
subject: servlet communication on different servers.