On Mon, 18 Aug 2003, Andrew Hill wrote: > Date: Mon, 18 Aug 2003 17:12:34 +0800 > From: Andrew Hill <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] > To: Struts Users Mailing List <[EMAIL PROTECTED]> > Subject: RE: [OT]Servlet Context/Static Fields > > If your in a distributed environment changes you make to properties of those > static classes will not be propogated to other JVMS (or indeed other > classloaders), whereas the stuff in ServletContext should be (though Id love > to hear an explanation of how it knows when to do it!). >
Propogation in a distributed app server is actually only guaranteed (in the J2EE specs) for *HttpSession* attributes, not *ServletContext* attributes. It's certainly possible for a server to offer replication of context attributes as well, but you can't rely on that to be portable. The strategy for knowing when to replicate session attributes (and it would probably apply to context attributes as well) is typically a configuration option in a server-specfic deployment descriptor. One could imagine doing it on a timed basis, or whenever setAttribute() is called again, or having some out-of-band method of signalling the server that this attribute has been modified. Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

