wood burning stoves 2.0*
The moose likes Servlets and the fly likes Servlet Collaboration, and dispatching request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Collaboration, and dispatching request" Watch "Servlet Collaboration, and dispatching request" New topic
Author

Servlet Collaboration, and dispatching request

arif azim
Greenhorn

Joined: Mar 26, 2002
Posts: 7
I need to create a network of web servers for distributed applications. I want users to acess servlets at any server and the servlet at that server then passes information to a servlet at a central server. The central server then invokes another servlet at the original/other servers. I think this can be accomplished by servlet chaining but it seems there is some issue with containers supporting servlet chaining. Please suggest what protocol can be used to invokes servlets through servlets especially across web servers. :roll: :roll:
Karl Moss
Author
Greenhorn

Joined: Feb 08, 2002
Posts: 18
If you are on the same server you would use a RequestDispatcher to dispatch a request to another servlet. If you want to work with a servlet running on a different server then you will need to open a URLConnection and issue an HTTP request to that server and then read the response. Depending upon what you need to do you can work with either plain text, binary data, or serialized objects. If you need an example, pick up the Applet to Servlet Communication Web Application from http://www.servletguru.com/downloads.htm. There are a couple of simple examples included where a Java application calls a servlet; you could just as easily use this code from within a servlet to call another servlet.
Hope this helps.


Karl Moss,<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/007222262X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Java Servlets Developer's Guide</a> <br /><a href="http://www.servletguru.com" target="_blank" rel="nofollow">ServletGuru.com</a> the Companion site.
arif azim
Greenhorn

Joined: Mar 26, 2002
Posts: 7
Thank you sir!........
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Collaboration, and dispatching request
 
Similar Threads
Deploying the application on to server
servlet load issue
servlet communication between two JVMs
servlet unloading
Tomcat Vs. Other web servers