Johri, Priyank <[EMAIL PROTECTED]> wrote:
>
> Folks,
> This is my second post (didn't get answers to the first one!).
> I want to know how to make servlets communicate with each other.
> I specifically want to know how I can create a singleton object and access
> it
> from two different servlets. I tried doing this but it does not work.
> It looks like that the servlets are being loaded by different classloaders
> or in a different contexts, and the instance of the singleton is not the
> same for both.
> Any help is appreciated.

They _have_ to be in the same context (same web-app), and then you can use
the ServletContext methods. If they're not in the same context, you can't.

    Pier

--
Pier Fumagalli - Sun Microsystems, INC - <mailto:[EMAIL PROTECTED]>
I'm selling my Sony Vaio Z505. Check out <http://www.betaversion.org/~pier/>

___________________________________________________________________________
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