Stepan,
Stepan,
The mechanism for storing session and application objects are indeed
Thread Safe. However its up to the programmer to ensure that the
Objects being used are thread safe. This is stressed many times in the
Servlet API.
For instance if I have a Object or Servlet that has a recursive call
then we have a problem. If I have a shared Object with the method foo,
I the developer must make sure simulataneous calls to foo is feasible
and does not cause conflict - e.g foo may be calling a member variable
that is not synchronized.
Gabriel
Stepan Schejbal wrote:
>
> Gabriel Wong wrote:
>
> > Matti,
> >
> > Assuming you are using the .92 Specs:
> >
> > > Hi all! Whats the best way of sharing an object between different users on
> > > different jsp pages?
> >
> > Set the Beans lifespan to "application".
> > <USEBEAN NAME=instancename TYPE= "mypackage.MyBean" lifespan =
> > "application">
> > </USEBEAN>
> >
> > Also, what do I have to think about to make it thread
> > > safe?
> > This is left to the programmer.
>
> It's false.
>
> from JSP 0.92 spec - Session Tracking paragraph:
>
> With JavaServer Pages, webpage authors don't need to worry about managing cookies --
> the server takes care of the saving state between the client and server. Because
> JavaServer Pages takes care of thread contention, you can be assured there is only
> one thread working on your session object -- similarly for applications. Request
> objects are strictly thread-safe.
>
> Stepan
>
> ===========================================================================
> 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".
===========================================================================
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".