It doesn't mean it's useless, just that it's not useful as a place to store global information. It's still a good place to store things that you only want one of per server.



Mohan Radhakrishnan wrote:

Hi
  I read the following spec. This means that in a clustered environment the
application scope
is useless. I can't really believe this. Why do we have this scope then ?

Mohan


The Server Specification states the following:


"javax.servlet
Interface ServletContext

----------------------------------------------------------------------------
----

public abstract interface ServletContext
Defines a set of methods that a servlet uses to communicate with its servlet
container, for example, to get the MIME type of a file, dispatch requests,
or write to a log file.

There is one context per "web application" per Java Virtual Machine. (A "web
application" is a collection of servlets and content installed under a
specific subset of the server's URL namespace such as /catalog and possibly
installed via a .war file.)

In the case of a web application marked "distributed" in its deployment
descriptor, there will be one context instance for each virtual machine. In
this situation, the context cannot be used as a location to share global
information (because the information won't be truly global). Use an external
resource like a database instead.

The ServletContext object is contained within the ServletConfig object,
which the Web server provides the servlet when the servlet is initialized. "


--------------------------------------------------------------------- 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