I'll assume you mean shared between separate web applications, as, within a single web app. is nothing special. The key is the classloader. In order for the singleton to be a true singleton, (not one fo reach webapp) it must be loaded rom a common classloader. So the jar it is loaded from should probably be in common/lib. See http://tomcat.apache.org/tomcat-4.1-doc/class-loader-howto.html for more on Tomcat classloader hierarchy.
Please respond to "Tomcat Users List" <users@tomcat.apache.org> To: "Tomcat Users List" <users@tomcat.apache.org> cc: Subject: Singleton and ServletContext Dear All, Is there anyone can point me to any sample how to use singleton object across web application in Tomcat ? -- Regards, Feris PT. Putera Handal Indotama JL. KH. Moh. Mansyur No. 11 Blok B.8-12 Telp. +62-21-631 6688 (Hunting) Fax. +62-21-6330211 Jakarta (10140) - INDONESIA