tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Stavrinides <P.Stavrini...@albourne.com>
Subject Re: T5: how to detect session timeout?
Date Wed, 03 Dec 2008 11:59:31 GMT

I use a RequestFilter instead of a dispatcher to achieve same thing... but it should work
just the same for you (before:PageRender is fine). In your dispatcher you need to check your
state object for null and redirect to your login page.

For example:
if(applicationStateManager.get(SiteSessionAccess.class) == null){
	response.sendRedirect(loginPage);
        return true;
}

Short-circuits the page load.


-- 
If you are not an intended recipient of this e-mail, please notify the sender, delete it and
do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html
for important additional terms relating to this e-mail.

----- Original Message -----
From: "tapestryphoto" <photos@digiatlas.org>
To: users@tapestry.apache.org
Sent: Wednesday, 3 December, 2008 1:42:53 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: T5: how to detect session timeout?

Hi,

I am trying to deal with session timeouts in T5.

Rather than extend a base class I was hoping I might be able to use an  
Annotation. However, I find that when the user activates a link or  
presses a button on a timed-out session that the dispatcher is not  
being called early enough to detect anything and I end up with a null  
pointer exception.

I have the following in my AppModule:

		configuration.add("TimeoutDetector", timeoutDetector,
		"before:PageRender");

Two questions:

a) is it possible to detect Session timeouts in this way?

b) As PageRender isn't early enough can I hook this in earlier? I'd  
also appreciate knowing what values can be placed in that parameter.  
Nowhere can I find this documented (apart from a reference to  
"before:" and "after:"). I've even looked in the T5 code but I'm  
afraid there is just too much of it to look through. Surely the  
specification of part of a page lifecycle would be better as something  
other than a String?!

thanks,
p.



---------------------------------------------------------------------
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


Mime
View raw message