Hi,
What container are you using? Which version of API are you using?
If the version is 2.2 or above and both the servlets are in the same context
(web application) then you should get only one class.
There will be one class for each context, as different contexts have
different classloaders.
If you want to share the instance across contexts, you have two ways.
1. Put the class on the classpath.
2. Put the class in the directory taking the container wide libs.
Regds,
Gokul
----- Original Message -----
From: "Johri, Priyank" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 31, 2001 12:24 AM
Subject: [SERVLET-INTEREST] Interservlet Communication
> 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.
>
> Priyank
>
>
___________________________________________________________________________
> 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