You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/11/28 11:45:56 UTC

T5: cleaning up persisted objects during user logout

Hi,
I have a few pages that has some @Persist objects, I'd like to release all
those objects when user log out the application so that the next login user
will not see those persisted objects that are supposed to be visible to only
the previous user, any way to handle this? Thanks,

A.C.
-- 
View this message in context: http://www.nabble.com/T5%3A-cleaning-up-persisted-objects-during-user-logout-tf4887697.html#a13989875
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: cleaning up persisted objects during user logout

Posted by Josh Canfield <jo...@thedailytube.com>.
You can grab a the actual HttpSession object and invalidate it.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSession.html#invalidate
()
Josh
On Nov 28, 2007 2:45 AM, Angelo Chen <an...@yahoo.com.hk> wrote:

>
> Hi,
> I have a few pages that has some @Persist objects, I'd like to release all
> those objects when user log out the application so that the next login
> user
> will not see those persisted objects that are supposed to be visible to
> only
> the previous user, any way to handle this? Thanks,
>
> A.C.
> --
> View this message in context:
> http://www.nabble.com/T5%3A-cleaning-up-persisted-objects-during-user-logout-tf4887697.html#a13989875
> Sent from the Tapestry - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: T5: cleaning up persisted objects during user logout

Posted by Josh Canfield <jo...@thedailytube.com>.
Doh! didn't read your answer before posting... also didn't bother to look
and see that the tapestry Session exposes invalidate.

On Nov 28, 2007 6:16 AM, anujith amaratunga <
anujith.amaratunga@oneworldglobal.net> wrote:

>
> Hi,
>
> On Nov 28, 2007 4:20 PM, Marcus <mv...@gmail.com>; wrote:
> >
> > On Nov 28, 2007 4:15 PM, Angelo Chen <an...@yahoo.com.hk>;
> wrote:
> > >
> > > I have a few pages that has some @Persist objects, I'd like to release
> > all
> > > those objects when user log out the application so that the next login
> > user
> > > will not see those persisted objects that are supposed to be visible
> to
> > only
> > > the previous user, any way to handle this? Thanks,
> >
> > try @Persist("flash")
>
> Flash persistence will help but not completely address the concern. Flash
> objects are only cleared from the session when they are read. If they're
> not
> read for some reason, they aren't cleared.
>
> I'd just use Session.invalidate() on logout.
>
> http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/services/Session.html#line.65
> Mind you, the problem you mentioned will only apply if both users are on
> the
> same browser instance.
>
> cheers
>
> Anujith
> --
> View this message in context:
> http://www.nabble.com/T5%3A-cleaning-up-persisted-objects-during-user-logout-tf4887697.html#a13993127
>  Sent from the Tapestry - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: T5: cleaning up persisted objects during user logout

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Yeah, very sorry about that. You'll have to inject RequestGlobals and 
get the Session like this:

   @Inject
   private RequestGlobals requestGlobals;

   public String onActionFromLogout() {
     Session session = requestGlobals.getRequest().getSession(false);
     if (null != session) session.invalidate();
   }

-Filip

Marcelo Lotif skrev:
> Hi filip,
> How can i use it?
> 
> i tried this, but i got a bunch of exceptions...
> 
> @Inject
> private Session _session;
> 
> public String onActionFromLogout() {
>     _session.invalidate();
>     return "start";
> }
> 
> 
> 2007/11/29, Filip S. Adamsen <fs...@fsadev.com>:
>> Inject o.a.t.services.Session.
>>
>> -Filip
>>
>> Angelo Chen skrev:
>>> hi,
>>> this works, thanks. i use:
>>>    global.getHTTPServletRequest().getSession().Invalidate();
>>> I think T5 has a service of Session, how to obtain it?
>>>
>>>
>>>
>>> anujith amaratunga wrote:
>>>> Hi,
>>>>
>>>> On Nov 28, 2007 4:20 PM, Marcus <mv...@gmail.com>; wrote:
>>>>> On Nov 28, 2007 4:15 PM, Angelo Chen <an...@yahoo.com.hk>;
>> wrote:
>>>>>> I have a few pages that has some @Persist objects, I'd like to
>> release
>>>>> all
>>>>>> those objects when user log out the application so that the next
>> login
>>>>> user
>>>>>> will not see those persisted objects that are supposed to be visible
>> to
>>>>> only
>>>>>> the previous user, any way to handle this? Thanks,
>>>>> try @Persist("flash")
>>>> Flash persistence will help but not completely address the concern.
>> Flash
>>>> objects are only cleared from the session when they are read. If
>> they're
>>>> not read for some reason, they aren't cleared.
>>>>
>>>> I'd just use Session.invalidate() on logout.
>>>>
>> http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/services/Session.html#line.65
>>>> Mind you, the problem you mentioned will only apply if both users are
>> on
>>>> the same browser instance.
>>>>
>>>> cheers
>>>>
>>>> Anujith
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: cleaning up persisted objects during user logout

Posted by Marcelo Lotif <ml...@gmail.com>.
Hi filip,
How can i use it?

i tried this, but i got a bunch of exceptions...

@Inject
private Session _session;

public String onActionFromLogout() {
    _session.invalidate();
    return "start";
}


2007/11/29, Filip S. Adamsen <fs...@fsadev.com>:
>
> Inject o.a.t.services.Session.
>
> -Filip
>
> Angelo Chen skrev:
> > hi,
> > this works, thanks. i use:
> >    global.getHTTPServletRequest().getSession().Invalidate();
> > I think T5 has a service of Session, how to obtain it?
> >
> >
> >
> > anujith amaratunga wrote:
> >> Hi,
> >>
> >> On Nov 28, 2007 4:20 PM, Marcus <mv...@gmail.com>; wrote:
> >>> On Nov 28, 2007 4:15 PM, Angelo Chen <an...@yahoo.com.hk>;
> wrote:
> >>>> I have a few pages that has some @Persist objects, I'd like to
> release
> >>> all
> >>>> those objects when user log out the application so that the next
> login
> >>> user
> >>>> will not see those persisted objects that are supposed to be visible
> to
> >>> only
> >>>> the previous user, any way to handle this? Thanks,
> >>> try @Persist("flash")
> >> Flash persistence will help but not completely address the concern.
> Flash
> >> objects are only cleared from the session when they are read. If
> they're
> >> not read for some reason, they aren't cleared.
> >>
> >> I'd just use Session.invalidate() on logout.
> >>
> http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/services/Session.html#line.65
> >> Mind you, the problem you mentioned will only apply if both users are
> on
> >> the same browser instance.
> >>
> >> cheers
> >>
> >> Anujith
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Atenciosamente,
Marcelo Lotif

Re: T5: cleaning up persisted objects during user logout

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Inject o.a.t.services.Session.

-Filip

Angelo Chen skrev:
> hi,
> this works, thanks. i use:
>    global.getHTTPServletRequest().getSession().Invalidate();
> I think T5 has a service of Session, how to obtain it?
> 
> 
> 
> anujith amaratunga wrote:
>> Hi,
>>
>> On Nov 28, 2007 4:20 PM, Marcus <mv...@gmail.com>; wrote:
>>> On Nov 28, 2007 4:15 PM, Angelo Chen <an...@yahoo.com.hk>; wrote:
>>>> I have a few pages that has some @Persist objects, I'd like to release
>>> all
>>>> those objects when user log out the application so that the next login
>>> user
>>>> will not see those persisted objects that are supposed to be visible to
>>> only
>>>> the previous user, any way to handle this? Thanks,
>>> try @Persist("flash")
>> Flash persistence will help but not completely address the concern. Flash
>> objects are only cleared from the session when they are read. If they're
>> not read for some reason, they aren't cleared.
>>
>> I'd just use Session.invalidate() on logout.
>> http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/services/Session.html#line.65
>> Mind you, the problem you mentioned will only apply if both users are on
>> the same browser instance.
>>
>> cheers
>>
>> Anujith
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: cleaning up persisted objects during user logout

Posted by Angelo Chen <an...@yahoo.com.hk>.
hi,
this works, thanks. i use:
   global.getHTTPServletRequest().getSession().Invalidate();
I think T5 has a service of Session, how to obtain it?



anujith amaratunga wrote:
> 
> Hi,
> 
> On Nov 28, 2007 4:20 PM, Marcus <mv...@gmail.com>; wrote:
>> 
>> On Nov 28, 2007 4:15 PM, Angelo Chen <an...@yahoo.com.hk>; wrote:
>> > 
>> > I have a few pages that has some @Persist objects, I'd like to release
>> all
>> > those objects when user log out the application so that the next login
>> user
>> > will not see those persisted objects that are supposed to be visible to
>> only
>> > the previous user, any way to handle this? Thanks,
>> 
>> try @Persist("flash")
> 
> Flash persistence will help but not completely address the concern. Flash
> objects are only cleared from the session when they are read. If they're
> not read for some reason, they aren't cleared.
> 
> I'd just use Session.invalidate() on logout.
> http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/services/Session.html#line.65
> Mind you, the problem you mentioned will only apply if both users are on
> the same browser instance.
> 
> cheers
> 
> Anujith
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-cleaning-up-persisted-objects-during-user-logout-tf4887697.html#a14017172
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: cleaning up persisted objects during user logout

Posted by anujith amaratunga <an...@oneworldglobal.net>.
Hi,

On Nov 28, 2007 4:20 PM, Marcus <mv...@gmail.com>; wrote:
> 
> On Nov 28, 2007 4:15 PM, Angelo Chen <an...@yahoo.com.hk>; wrote:
> > 
> > I have a few pages that has some @Persist objects, I'd like to release
> all
> > those objects when user log out the application so that the next login
> user
> > will not see those persisted objects that are supposed to be visible to
> only
> > the previous user, any way to handle this? Thanks,
> 
> try @Persist("flash")

Flash persistence will help but not completely address the concern. Flash
objects are only cleared from the session when they are read. If they're not
read for some reason, they aren't cleared.

I'd just use Session.invalidate() on logout.
http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/services/Session.html#line.65
Mind you, the problem you mentioned will only apply if both users are on the
same browser instance.

cheers

Anujith
-- 
View this message in context: http://www.nabble.com/T5%3A-cleaning-up-persisted-objects-during-user-logout-tf4887697.html#a13993127
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: cleaning up persisted objects during user logout

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Marcus,

It does not work in my situation: in a file upload page, I keep a list of
files uploaded by the user, the list is persisted session wide, if the user
quits and another user logs in, the latter will see the entire list, if I
use 'flash', it will not persisted between the file uploads. any idea?
Thanks,
A.C.


Marcus-11 wrote:
> 
> Hi Angelo,
> 
> try @Persist("flash")
> 
> Marcus
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-cleaning-up-persisted-objects-during-user-logout-tf4887697.html#a13991758
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: cleaning up persisted objects during user logout

Posted by Marcus <mv...@gmail.com>.
Hi Angelo,

try @Persist("flash")

Marcus