tomcat-users mailing list archives

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

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

OK.  Makes sense ;)

>I have attempted your second idea. And yes I go to the DB for each
>The problem with the Singleton is, I donno who should start the class.
>the HTML servlet starts the Singleton, will the object still be
>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

View raw message