Howdy,

>* How does scoping work in Tomcat?

The same as in all java programs.

>* Why would you bother using a singleton when you're working with
Tomcat?
>
>Why would scoping be different in tomcat than any other
>servlet-complying container?  What does a singleton have to do
>with a web container?

You would use a singleton in tomcat for the same reasons you would in
other programs.  One advantage a singleton has in a servlet container
like tomcat is that all the webapps run in one JVM but their own
classloaders, with one common parent classloader.  If your singleton is
in that classloader (the "shared" or "common" classloader in tomcat
parlance) then all your webapps see the same instance of this singleton,
thereby making it a suitable location to place objects that you want to
share across webapps.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to