tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tapestryphoto <pho...@digiatlas.org>
Subject Re: T5: how to detect session timeout?
Date Wed, 03 Dec 2008 14:01:39 GMT
Thanks Peter.

The problem was in the dispatcher code that disassembles the URL. The  
code that I grabbed from the wiki (as I recall) checks for / but  
doesn't account for . when attempting to obtain the page name. While  
I've had a security dispatcher working for some time that uses that  
code, this version was not working because when clicking on a link the  
path is of the form:  ftpaccess.changedirectory/pub (when I needed the  
page called ftpaccess).

All fixed now and works as expected.

p.


Quoting Peter Stavrinides <P.Stavrinides@albourne.com>:

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




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


Mime
View raw message