Hi!

Do you want to share some kind of global variables or session information? Global variables should exist only once while session information is stored for each user (to be more correct: for each user-session).

I think you want to share session-information, but using a class-variable from a class that is loaded by the shared-classloader is nothing else but sharing a global variable. So if you really want to do that: Your solution might work, but it is not recommended. I think using a directory service is the better way! Tomcat has a built-in JNDI context where you can put such global things. (For more information have a look at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html).
But as I said: All you do is sharing global information that exists only once!


Best regards,
 Tex

So...
If I create some class, SessionHolder.java, compile it (SessionHolder.class)
and put it in shared/lib, I could then set variables and then retrieve them
from this class?



Charlie



Caldarale, Charles R said the following on 2/2/2005 5:00 PM:

From: Mark Winslow [mailto:[EMAIL PROTECTED]
Subject: Re: sharing session across <Host>s

I imagine creating a static variable would be global
to the JVM.


Not quite. It's global to the classloader, not the JVM. Since each web app has its own classloader, you would have to put such a class in a location serviced by a more global loader, such as shared/lib. Now, of course, you've introduced dependency issues...

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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






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





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



Reply via email to