For communicating with servlets in the same VM, I suggest one could make
use of the RequestDispatcher interface's forward() method.

I have worked this out as an example and it works without any problem.

For communicating between servlets that are in different VMs, I read that
one has to open an URLConnection(HttpURLConnection??). I have tried this
out but so far, I have not been successful on this.

Any pointers to this would be helpful.

Thanks in advance,

Girish

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Buhr,
Kevin
Sent: Saturday, June 24, 2000 01:50
To: [EMAIL PROTECTED]
Subject: servlet to servlet communication


What's the best way for one servlet to pass information to another servlet?
What's the best accepted practice nowadays? Believe this scenario will
involve multiple web pages being called in some kind of sequence by the
user, and multiple servlets may be involved. Wouldn't think that session
info. could/should be used in this way. Think that each servlet would/should
have it's own separate and independent session info.. Saw in "Developing
JAVA Servlets"(HTTP Tunneling chapter) book where the author shows how a
applet can call/pass info. to a servlet by creating a new URL then opening a
URLConnection then writing to the URLConnection's ObjectOutputStream which I
guess calls the servlet. Would assume that a servlet could call another
servlet this way.  Looks like would have to write a service request method
in the receiving servlet to do this.

Read about Servlet Chaining as well. But am not sure if the servlets will
always be called in a certain order every time. Know all this is very vague,
but was asked a very quick question without much background info. given and
like allot of people I am new to servlets. Any ideas? Comments? Advice?
Tried to look in the archives but didn't see any specific answers to this.
Saw where someone else asked this question before.

Thank's in advance.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to