You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Simon Raveh <sr...@gmail.com> on 2007/04/27 23:22:54 UTC
Session timeout and callback
Hi,
I'm developing an application using Tapestry 4 and I have a question
regarding session timeout.
when the session timeout I'm trying to create a callback object to an
IExternaLPage using this code in my pageValidate method
Callback callback = new ExternalCallback(pageName,
getPageName(),getRequestCycle().getListenerParameters());
Login login = getLogin();
login.setCallback(callback);
throw new PageRedirectException(login);
The problem is that getListenerParameters is always null.
What or how can I restore the state of the page after Login.
Thanks,
Simon
Re: Session timeout and callback
Posted by Jesse Kuhnert <jk...@gmail.com>.
The listener parameters won't have the state of your page (in most
instances). .
What you have to do is implement IExternalPage (
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/IExternalPage.html)
on your page class like so:
@Persist
public abstract void setUserId(String madeUpId);
public void activateExternalPage(Object[] parameters, IRequestCycle cycle)
{
String userId = (String)parameters[0];
setUserId(userId);
}
The parameters that you give in the ExternalCallback constructor will be the
same values passed back into your page in the activateExternalPage method.
Sometimes it's possible to automate the process a little more but with the
many varied ways people use state schemes it's probably best to start with
this first and then move out from there.
On 4/27/07, Simon Raveh <sr...@gmail.com> wrote:
>
> Hi,
>
> I'm developing an application using Tapestry 4 and I have a question
> regarding session timeout.
> when the session timeout I'm trying to create a callback object to an
> IExternaLPage using this code in my pageValidate method
>
> Callback callback = new ExternalCallback(pageName,
> getPageName(),getRequestCycle().getListenerParameters());
> Login login = getLogin();
> login.setCallback(callback);
> throw new PageRedirectException(login);
>
> The problem is that getListenerParameters is always null.
> What or how can I restore the state of the page after Login.
>
> Thanks,
> Simon
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com