Re: Interaction between servlets residing on two different servers
Thursday, December 13, 2001 01:00 PM
you can forward the request to another server once you forwarded, the control is in the hands of the second server. if you want to get the control back, you have to know that server 2 is going to return the request and response back to you. but you cannot call servlet on another server (or on the same server) as you would call a method on some class and get the control of execution back. servlets are not designed to be used that way. what you need to do is extract the logic the server 2 does and perform it on the server 1 or make sure that once you forwarded to server 2 you do not need the control back in server 1, i.e. have server 1 do all its job and send request and response to server 2 to do its and send results back to the client. there is no reason to go back and forth and if there is it is a flaw in the design.