Mike Engelhart wrote:
> So since it is stored in a session object, it's guaranteed to be unique
> then for the client? (i.e. thread safe)
>
> Mike
>
Unique to that client -- yes, as long as you are diligent about creating and
maintaining session state everywhere.
Thread-safe -- not at all. There is no restriction on a client browser issuing
more than one simultaneous request with the same session identifier. You need to
perform appropriate thread-safe programming around your application objects, if
this is necessary.
In practice, this latter issue isn't usually a big deal. The place where it can
really bite, though, is a user who opens two windows and is using cookies for
session management. Because of the way that browsers deal with cookies, the server
sees both windows as part of the same session, so you will get clashes on things
like the "error message" bean that was the motivation for this thread.
Craig McClanahan
>
> ----------
> >From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> >To: Java Apache Users <[EMAIL PROTECTED]>
> >Subject: Re: setAttribute() ???
> >Date: Sat, Jun 19, 1999, 10:19 AM
> >
>
> > To simulate the behavior of request-scope beans like validation
> > messages, I tend to either have my JSP page delete these objects as soon as it
> is
> > through with it, or keep re-using the same session key for the same purpose
> (like
> > using key "errorMessage" for all error messages that only need to appear
> once).
> > This effectively deletes the old value and adds the new one.
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> READ THE FAQ!!!! <http://java.apache.org/faq/>
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]