File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Collaboration, and dispatching request

 
arif azim
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
arif azim
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir!........
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic