You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Paul Szego <pa...@nebulon.com> on 2002/02/20 08:47:30 UTC
Session scope tools
Hi,
I'm just getting going with Turbine/Velocity, and have some questions
about "session" tools and their lifecycle.
My understanding is that the tool will be initialised with a User object
and placed in the tempStorage of that User. However I can't see how to
tell when the session is "over".
My solutions so far are to either (1) implement
HttpSessionBindingListener and bind myself to the servlet session and
work from HttpSessionBindingEvent's myself, or (2) extend TurbineUser
and override the valueUnbound() and do some tricks there.
In the second approach I look through each object in the tempStorage,
and if it implements HttpSessionBindingListener I call the
valueUnbound() method on it. Then I call super.valueUnbound() to let the
TurbineUser object do its thing.
Is there any other way to do this? Am I missing something completely?
Regards, PaulS.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Session scope tools
Posted by Peter Lynch <pe...@mindspring.com>.
PaulS,
----- Original Message -----
From: "Paul Szego" <pa...@nebulon.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Tuesday, February 19, 2002 11:47 PM
Subject: Session scope tools
>
> Hi,
>
> I'm just getting going with Turbine/Velocity, and have some questions
> about "session" tools and their lifecycle.
>
> My understanding is that the tool will be initialised with a User object
> and placed in the tempStorage of that User. However I can't see how to
> tell when the session is "over".
>
> My solutions so far are to either (1) implement
> HttpSessionBindingListener and bind myself to the servlet session and
> work from HttpSessionBindingEvent's myself, or (2) extend TurbineUser
> and override the valueUnbound() and do some tricks there.
I chose number 2.
Found a bug though with the pull service in Turbine2.1 that I don't know if
it was ever formally addressed. Seems Session scope pull tools are never
returned to the pool. So in the valueUnbound, I do a TurbinePool.put for
each object in tempstorage ( only because I only use TempStorage for session
pull tools and nothing else).
Anyways, just a warning to keep track of all those instances running
around...
-Peter
>
> In the second approach I look through each object in the tempStorage,
> and if it implements HttpSessionBindingListener I call the
> valueUnbound() method on it. Then I call super.valueUnbound() to let the
> TurbineUser object do its thing.
>
> Is there any other way to do this? Am I missing something completely?
>
> Regards, PaulS.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>