I have done applet-servlet communication by opening HttpUrlConnection. That
works cool. But,
when it comes to servlet-servlet, I think POST is a better way to handle
this.
-meera



-----Original Message-----
From: Chen, Gin [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 3:32 PM
To: [EMAIL PROTECTED]
Subject: Re: communicating directly with a servlet


It will work across containers if the containers are part of a cluster for
the same application (at least in webLogics, I havent checked the Tomcat
docs).
If they were on different applications and different servers you cant even
use the RequestDispatcher or the same session/context so you would have to
open a URLConnection to communicate with another webapp servlet.
If that were the case, then just send it via an ObjectOutputStream. It'll be
ugly though.
Look at chapter 10 of Jason Hunter's Java Servlet Programming (O'Reilly).
It shows an example with servlet and applet. But u can do one from servlet
to servlet.
-Tim

-----Original Message-----
From: Prabhu, Deepak [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 3:12 PM
To: [EMAIL PROTECTED]
Subject: Re: communicating directly with a servlet


I don't think this would work as the ServletContext is related to the
servlet container and this will not work if the servlet containers are
different.

Deepak

-----Original Message-----
From: Tony LaPaso [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 3:02 PM
To: [EMAIL PROTECTED]
Subject: Re: communicating directly with a servlet


Can you put the Hashtable in the context?

That is, within your servlet, do this:

getServletContext().setAttribute("MyHashtable", ht);

Then to retrieve the Hashtable the other servlet calls getAttribute() on its
ServletContext:

ht = (Hashtable)getServletContext().getAttribute("MyHashtable");



----- Original Message -----
From: "Charles Conover" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 08, 2002 1:21 PM
Subject: communicating directly with a servlet



> Is there a way to connect directly with a servlet, except with the doGet
and
> doPost methods?  What I am trying to do is share info (specifically the
> contents of a hashtable) between 2 servlets.  I could probably create a
Post
> with all the data in parameters, but I was wondering if anyone knew an
> easier way.
> Thanks,
> Chuck
>
>
___________________________________________________________________________
> 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

___________________________________________________________________________
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

___________________________________________________________________________
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