You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Max Grigoriev <da...@mail.ru> on 2003/09/23 11:23:13 UTC
Invalidate the session
Hello tapestry-user,
Is there such thing like clear visit object?
I tried to do "session.invalidate()" but in this case i get session
expired error.
Thank's
--
Best regards,
Max mailto:darkit@mail.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re[2]: Invalidate the session
Posted by Max Grigoriev <da...@mail.ru>.
It's working OK for visit object. But what have i do with page
persisten properties ?
Page Spec:
<property-specification name="bean" persistent="yes"
type="com.clearview.feedback.web.page.ReportEntryBean"/>
Page Source :
public void finishLoad(IRequestCycle cycle, IPageLoader iPageLoader, IComponentSpecification iComponentSpecification) {
super.finishLoad(cycle, iPageLoader, iComponentSpecification);
Organization org = ((Visit)getVisit()).getOrganization();
if (getBean() == null) {
setBean(new ReportEntryBean());
}
if(getBean().getOrganization() == null ||
!getBean().getOrganization().equals(org)) {
getBean().initFeedbackCategories(org.getCategoryTypes());
getBean().setOrganization(org);
}
}
public abstract ReportEntryBean getBean();
public abstract void setBean(ReportEntryBean bean);
This property restore its state after engine.restart().
How can i reset its state?
Thank's
Wednesday, September 24, 2003, 4:17:59 AM, you wrote:
HK> Try engine.restart(cycle) instead. You may override this for a custom
HK> implementation. See javadocs for AbstractEngine.restart. Hope it helps.
HK> -Harish
HK> Bryan Lewis wrote:
>>Here's what I do when the user clicks 'Logout' button. Basically I
>>nullify everything I can think of. It might not be perfect... in fact
>>you'll see in the comments that I had to do a bit of a work-around. I'd
>>be happy to hear a better way.
>>
>> public void formSubmit(IRequestCycle cycle)
>> {
>> // On clicking the logout button...
>> // Drop the user in the visit.
>> IEngine engine = getPage().getEngine();
>> Map visit = (Map) engine.getVisit();
>> visit.put("user", null);
>>
>> // Clear the visit in the engine to make sure the session
>> // forgets this user. Had some troubles in the first
>> // release with new users getting a form automatically
>> // filled in with an old user's userName/password.
>> engine.setVisit(null);
>> login = null;
>> password = null;
>> // Not required, but maybe this will help the garbage collector.
>> visit = null;
>>
>> // Now go to a static LoggedOut 'thank-you' page. If I leave
>>the
>> // user on the same page and they re-click Login, it causes
>> // a StaleLinkException. TODO: Figure out some day.
>> cycle.activate("LoggedOut");
>> }
>>
>>
>>----- Original Message -----
>>From: "Max Grigoriev" <da...@mail.ru>
>>To: <ta...@jakarta.apache.org>
>>Sent: Tuesday, September 23, 2003 5:23 AM
>>Subject: Invalidate the session
>>
>>
>>
>>
>>>Hello tapestry-user,
>>>
>>> Is there such thing like clear visit object?
>>> I tried to do "session.invalidate()" but in this case i get session
>>> expired error.
>>>
>>>Thank's
>>>
>>>--
>>>Best regards,
>>> Max mailto:darkit@mail.ru
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail:
>>>tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail:
>>>tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
--
Best regards,
Max mailto:darkit@mail.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Invalidate the session
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Try engine.restart(cycle) instead. You may override this for a custom
implementation. See javadocs for AbstractEngine.restart. Hope it helps.
-Harish
Bryan Lewis wrote:
>Here's what I do when the user clicks 'Logout' button. Basically I
>nullify everything I can think of. It might not be perfect... in fact
>you'll see in the comments that I had to do a bit of a work-around. I'd
>be happy to hear a better way.
>
> public void formSubmit(IRequestCycle cycle)
> {
> // On clicking the logout button...
> // Drop the user in the visit.
> IEngine engine = getPage().getEngine();
> Map visit = (Map) engine.getVisit();
> visit.put("user", null);
>
> // Clear the visit in the engine to make sure the session
> // forgets this user. Had some troubles in the first
> // release with new users getting a form automatically
> // filled in with an old user's userName/password.
> engine.setVisit(null);
> login = null;
> password = null;
> // Not required, but maybe this will help the garbage collector.
> visit = null;
>
> // Now go to a static LoggedOut 'thank-you' page. If I leave
>the
> // user on the same page and they re-click Login, it causes
> // a StaleLinkException. TODO: Figure out some day.
> cycle.activate("LoggedOut");
> }
>
>
>----- Original Message -----
>From: "Max Grigoriev" <da...@mail.ru>
>To: <ta...@jakarta.apache.org>
>Sent: Tuesday, September 23, 2003 5:23 AM
>Subject: Invalidate the session
>
>
>
>
>>Hello tapestry-user,
>>
>> Is there such thing like clear visit object?
>> I tried to do "session.invalidate()" but in this case i get session
>> expired error.
>>
>>Thank's
>>
>>--
>>Best regards,
>> Max mailto:darkit@mail.ru
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
Re: Invalidate the session
Posted by Bryan Lewis <br...@maine.rr.com>.
Here's what I do when the user clicks 'Logout' button. Basically I
nullify everything I can think of. It might not be perfect... in fact
you'll see in the comments that I had to do a bit of a work-around. I'd
be happy to hear a better way.
public void formSubmit(IRequestCycle cycle)
{
// On clicking the logout button...
// Drop the user in the visit.
IEngine engine = getPage().getEngine();
Map visit = (Map) engine.getVisit();
visit.put("user", null);
// Clear the visit in the engine to make sure the session
// forgets this user. Had some troubles in the first
// release with new users getting a form automatically
// filled in with an old user's userName/password.
engine.setVisit(null);
login = null;
password = null;
// Not required, but maybe this will help the garbage collector.
visit = null;
// Now go to a static LoggedOut 'thank-you' page. If I leave
the
// user on the same page and they re-click Login, it causes
// a StaleLinkException. TODO: Figure out some day.
cycle.activate("LoggedOut");
}
----- Original Message -----
From: "Max Grigoriev" <da...@mail.ru>
To: <ta...@jakarta.apache.org>
Sent: Tuesday, September 23, 2003 5:23 AM
Subject: Invalidate the session
> Hello tapestry-user,
>
> Is there such thing like clear visit object?
> I tried to do "session.invalidate()" but in this case i get session
> expired error.
>
> Thank's
>
> --
> Best regards,
> Max mailto:darkit@mail.ru
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org