Classes are unique per classloader not per vm.

A system like tomcat has serveral classloaders.

Each webapp has it's own classloader. 

If a class is loaded through the classloader of 
a webapp all static variables of the class are 
local to the webapp and each webapp can have it's 
own version of the class. 

To share information between webapps you can use
static variables of a class that is stored in place
that is loaded by a classloader that is a parent of
the webapp classloader.

See also:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html


> -----Urspr�ngliche Nachricht-----
> Von: Andreas Probst [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 16. Oktober 2002 10:30
> An: Tomcat Users List
> Betreff: Re: Static class not working under multiple webapps 
> deployment
> 
> 
> Hello Donie and all others,
> 
> I think static classes are once per Java Virtual Machine. So 
> your question could be extended to: Is it compatible with the 
> specs to run all webapps within the same JVM? Is this behaviour 
> supposed to be portable to other servlet containers and later 
> versions of Tomcat?
> 
> If this behaviour is portable: Couldn't this be used to easily 
> communicate between webapps?
> 

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

Reply via email to