I had the same problem.
Here si how I solved it:
for JSDK 2.0 and before you can share objects by accessing public method and
objects of another servlet.
using getServletContex().getServlet( name ) to get the servlet object and
after checking that the handle is not null just reference it name.method.
This method has been deprecated in version 2.0, because it doesn't offere
any information on the state of the called servlet.
Version 2.1 offeres ServletContext().setAttrubute() and getAttriubute()
methods.
You can also use HttpSession.putValue() and getValue() mechanism
Jacek
> -----Original Message-----
> From: Randy Belknap [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, October 08, 1999 12:17
> To: [EMAIL PROTECTED]
> Subject: Re: QoW - How can I share objects among servlets?
>
> > But that does not solve the general
> > problem: A system administrator cannot just put your jar file in the
> CLASSPATH
> > and trust you if it contains suspicious 'static' code.
> >
>
> I'm not sure I see why static code is any worse a risk to the system
> than non-static code. If a class is in the classpath you can still
> instantiate it with 'new' and you will end up with access to the
> shareable resource. The security risk with singletons is to your own
> application; you are letting any application on the system get a
> reference to the actual shared resource. If this isn't a problem in
> your particular situation, I don't think you need to shy away from using
> a singleton to implement a shared resource in a pre 2.1 environment.
>
> __________________________________________________________________________
> _
> 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