On Tue, 26 Jul 2011 10:57:22 -0300, antalk <ant...@intercommit.nl> wrote:

I'm using an onException method in a 'base' page class (from which all pages extend):

You can easily turn this nice code into a mixin and not-so-easily apply it to all pages implementing a ComponentClassTransformWorker (get the MutableComponentModel and use its addMixinClassName() method) instead of using inheritance.


        Object onException(Throwable cause) {
                if (cause.getCause() instanceof AccessDeniedException) {
                        if (request.isXHR()) {
                                return loginPage;
                        }
                }
                return null;
        }


This way if a page throws an accessdeniedexception (in case of a session
timeout) AND the request is an AJAX type, then redirect the user back to the
loginPage;



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-tp4634714p4634876.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
http://www.arsmachina.com.br

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

Reply via email to