You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Manri Offermann <ta...@eastbeam.co.jp> on 2005/08/17 09:52:30 UTC

Using DirectCallback

Hello,

I have a DirectLink component which activates a "protected" page in its 
listener and therefore want to use the DirectCallback so unauthenticated 
users will be redirected to the login page.

The base class of my protected page implements the following (using tp4b4):

    public void pageValidate(PageEvent event) {
        if (!getVisitObject().isAuthenticated()) {
            if (LOG.isDebugEnabled())
                LOG.trace("Request from unauthenticated client - show 
login page");

            LoginPage loginPage = getLoginPage();
            if (this instanceof IExternalPage)
                loginPage.setCallback(new 
ExternalCallback((IExternalPage) this, 
getRequestCycle().getListenerParameters()));
            else
                loginPage.setCallback(new PageCallback(this));

            throw new PageRedirectException(loginPage);
        }
    }

I need a way to figure out which IDirect component or DirectLink has 
triggered the PageEvent. Any ideas? Or does anybody have an example of 
using the DirectCallback?


Thanks,


Manri


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