tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Sharing an object between servlets
Date Fri, 04 Oct 2002 15:22:10 GMT
Hi,

>The number of coordinates is huge - in thousands so cant put them in
the
>URL.

OK.  Makes sense ;)

>I have attempted your second idea. And yes I go to the DB for each
request.
>The problem with the Singleton is, I donno who should start the class.
If
>the HTML servlet starts the Singleton, will the object still be
accessible
>to the image servlet?

They both call MapSingleton.getInstance().  It starts itself, as the
constructor is private in the Singleton pattern.

It may also suit you to start it in a context listener on server
startup, and pre-populate what you need in the singleton.  

Yoav Shapira
Millennium ChemInformatics

Mime
View raw message