dcsimg
Interaction between servlets residing on two different servers
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Muhammad_Naseer
Posted On:   Thursday, December 13, 2001 12:44 PM

Hi,

I want my servlet running on server A to send request to a servlet running on a Server B and which does some processing and returns the results back. How can I achieve it?
Can I access Request and Response objects of called servlet from the calling servlet?

Re: Interaction between servlets residing on two different servers

Posted By:   Alex_Chaffee  
Posted On:   Monday, December 17, 2001 12:48 AM

Re: Interaction between servlets residing on two different servers

Posted By:   Bozidar_Dangubic  
Posted On:   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.
About | Sitemap | Contact