Brian Burridge wrote:

> Has anyone used the "application" lifespan? Am I correct in assuming
> that this functions similiar to a servlet, in that if I use
> "applicaiton" lifespan, the bean and its contents (objects) are
> accessible to that application, even across user sessions, until the
> server unloads the servlet, probably through shutdown/restart?
>
> I haven't used this lifespan before, but need to use a global object
> across sessions. I am using spec .92.
>
> Brian N. Burridge
> Lead Internet Analyst
> Cox Target Media
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JSP-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

This is almost, but not quite, correct.  Beans with "application" lifespan are
shared across servlets (in a particular servlet context) as well, because they
are stored in the servlet context with the setAttribute() method.  This was
not stated explicitly in the 0.92 spec, but is in the 1.0 spec (section
1.4.1).

This means that application-scoped beans have a lifespan totally independent
of the servlets that access them, which may be loaded and unloaded at any
time.  The simplest way to view it is that they have a lifespan equal to that
ends when you remove it, or when the servlet engine shuts down.

Craig McClanahan

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to