my dog learned polymorphism
The moose likes Servlets and the fly likes server to server call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "server to server call" Watch "server to server call" New topic

server to server call

amod gole
Ranch Hand

Joined: Dec 07, 2005
Posts: 83
hi all,

my question is simple,
i hava two weblogic server on two machin,
i am calling simple html file and using this html file and action attribute of form tag i am calling one servlet now in this servlet i am using requestDispatcher to call another servlet or html but when i am calling that second servlet i hava to provide absolute path or name of that servlet in requestDispatcher("name");
but what happens when that servlet is on another server
is their any way to call that servlet
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
You can try sendRedirect instead of dispatcher.

Tough in space?, <a href="" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="" target="_blank" rel="nofollow">Check it here.</a><br /><a href="" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
amod gole
Ranch Hand

Joined: Dec 07, 2005
Posts: 83
hi dema rogatkin ,

thanks for reply,but my question is slightly different.
i know that using sendRedirect we can call another html page

but when we are calling that page using redirect method we are loosing request object

please understand my question

server1 server2

servlet1 servlet2 servlet3 servlet4

requestDispatcher requestDispatcher
servlet1----------------->servlet2 servlet3----------------->servlet4

sendRedirect sendRedirect
servlet1----------------->servlet2 servlet3----------------->servlet4


now provide solution for ? if you know

Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1090
I think that you can only use requestDispatcher on a single server you can not transer a request from one domain to another.
I agree. Here's the link:
subject: server to server call
jQuery in Action, 3rd edition