Originally posted by Sarada Bhasker:
[...] I would like to know when should I use scope=application. [...] But what I don't understand is when does the application stops running in the case of JSP's.
In terms of visibility, application scope means that every page or
servlet in the application has access to that very same object (which immediately implies that it needs to be carefully synchronized indeed). In terms of lifetime, while session objects expire when the session times out, application scoped objects live "forever" (as long as the application lives, or until you clear them).
The application stops only when you shut down (or crash
) the server, or when you explicitly stop the application using a server management tool.
- Peter