A servlet can bind an object attribute into the context by name . Any object bound into a context is available to any other servlet that is part of the same web application. The following methods of ServletContext interface allow access to this functionality:
SRV.4.3.1 Context Attributes in a Distributed ContainerContext attributes exist locally in the VM in which they were created and placed. This prevents the ServletContext from being used as a distributed shared memory store. If information needs to be shared between servlets running in a distributed environment, that information should be placed into a session (see Chapter SRV.7, "Sessions"), a database, or set in an Enterprise JavaBean. |