I think that it's better to do that in void validate(IRequestCycle
cycle) from AbstractPage and throw RedirectException if the condition
is not met. It's called after page activating.

2005/8/20, Chris Chiappone <[EMAIL PROTECTED]>:
> I need to try a couple more things before I post, sorry for the spam,
> I realized I could throw a PageRedirectException for this.
> 
> On 8/19/05, Chris Chiappone <[EMAIL PROTECTED]> wrote:
> > Is it possible to do the following?
> >
> >        public void pageBeginRender(PageEvent event) {
> >                if (getAssessInfo().getUser() != null) {
> >                        PermissionValidator pv = new PermissionValidator();
> >                        if 
> > (!pv.validateAssessmentOwner(event.getRequestCycle(),
> >                                        getAssessInfo())) {
> >                                String error = "Access to this page
> > has been denied.";
> >                                DefaultErrorPage errorPage = 
> > (DefaultErrorPage)
> >
> > getRequestCycle().getPage("DefaultErrorPage");
> >                                errorPage.setError(error);
> >                                log.info(error);
> >                                getRequestCycle().activate(errorPage);
> >                                setAssessmentOwner(false);
> >                        }
> >                }
> >        }
> >
> > I basically want to redirect to an error page if the condition is met.
> >  This doesn't seem to be working for me.
> >
> >
> > --
> > ~chris
> >
> 
> 
> --
> ~chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to