On Tue, 26 Jul 2011 11:29:31 -0300, George Christman <gchrist...@cardaddy.com> wrote:

Hi guys, where does AccessDeniedException exist?

I guess it was just one fictional example . ..

Thiago, love the mixin
approach, not entirely sure how to create one though.

To begin with, if you haven't yet, you need to understand what a Tapestry mixin is, how it works and what can it do. It's a little bit surprising at first, but it's very, very powerful. Take a look at the documentation and the JumpStart examples.

The mixin itself is just copying your code to a new class under the mixins subpackage:

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

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
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