You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk> on 2007/11/01 13:15:46 UTC

{wicket 1.3 beta 4} Error handling (Internal error page)

Hi

Im doing some finishing touches at our web application. And Im trying to 
create a internal error page that gives the possibility for the user to 
get back to the page that caused the error, just in case that the 
circumstances that caused the error are gone.

Now this is what I've done :

in init of the application i've placed this:

    getApplicationSettings().setInternalErrorPage(InternalErrorPage.class);
        getExceptionSettings().setUnexpectedExceptionDisplay(
                IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);

    @Override
    public RequestCycle newRequestCycle(final Request request,
            final Response response) {
        return new WebRequestCycle(this, (WebRequest) request,
                (WebResponse) response){@Override
                public Page onRuntimeException(Page page, 
RuntimeException e) {
                    return new InternalErrorPage(page, e);
                }};
               
    }

But page are always null, is there something wrong with this approach? I 
also have an idea that the overide makes setting the 
applicationsettings/exceptionsettings unrelevant.

PS have looked at the wiki: 
http://cwiki.apache.org/WICKET/faqs.html#FAQs-HowdoIaddcustomerrorpages%2528likePageExpired%2529%253F

regards Nino

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


Re: {wicket 1.3 beta 4} Error handling (Internal error page)

Posted by Eelco Hillenius <ee...@gmail.com>.
Whatever you set in setInternalErrorPage is ignored if you override
onRuntimeException in a custom request cycle.

Eelco

On 11/1/07, Nino Saturnino Martinez Vazquez Wael
<ni...@jayway.dk> wrote:
> Appears I was wrong. This is actually working. I would still like to
> know if this is the correct way to do it?
>
> regards Nino
>
> Nino Saturnino Martinez Vazquez Wael wrote:
> > Hi
> >
> > Im doing some finishing touches at our web application. And Im trying
> > to create a internal error page that gives the possibility for the
> > user to get back to the page that caused the error, just in case that
> > the circumstances that caused the error are gone.
> >
> > Now this is what I've done :
> >
> > in init of the application i've placed this:
> >
> >
> > getApplicationSettings().setInternalErrorPage(InternalErrorPage.class);
> >        getExceptionSettings().setUnexpectedExceptionDisplay(
> >                IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
> >
> >    @Override
> >    public RequestCycle newRequestCycle(final Request request,
> >            final Response response) {
> >        return new WebRequestCycle(this, (WebRequest) request,
> >                (WebResponse) response){@Override
> >                public Page onRuntimeException(Page page,
> > RuntimeException e) {
> >                    return new InternalErrorPage(page, e);
> >                }};
> >                  }
> >
> > But page are always null, is there something wrong with this approach?
> > I also have an idea that the overide makes setting the
> > applicationsettings/exceptionsettings unrelevant.
> >
> > PS have looked at the wiki:
> > http://cwiki.apache.org/WICKET/faqs.html#FAQs-HowdoIaddcustomerrorpages%2528likePageExpired%2529%253F
> >
> >
> > regards Nino
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: {wicket 1.3 beta 4} Error handling (Internal error page)

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Appears I was wrong. This is actually working. I would still like to 
know if this is the correct way to do it?

regards Nino

Nino Saturnino Martinez Vazquez Wael wrote:
> Hi
>
> Im doing some finishing touches at our web application. And Im trying 
> to create a internal error page that gives the possibility for the 
> user to get back to the page that caused the error, just in case that 
> the circumstances that caused the error are gone.
>
> Now this is what I've done :
>
> in init of the application i've placed this:
>
>    
> getApplicationSettings().setInternalErrorPage(InternalErrorPage.class);
>        getExceptionSettings().setUnexpectedExceptionDisplay(
>                IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
>
>    @Override
>    public RequestCycle newRequestCycle(final Request request,
>            final Response response) {
>        return new WebRequestCycle(this, (WebRequest) request,
>                (WebResponse) response){@Override
>                public Page onRuntimeException(Page page, 
> RuntimeException e) {
>                    return new InternalErrorPage(page, e);
>                }};
>                  }
>
> But page are always null, is there something wrong with this approach? 
> I also have an idea that the overide makes setting the 
> applicationsettings/exceptionsettings unrelevant.
>
> PS have looked at the wiki: 
> http://cwiki.apache.org/WICKET/faqs.html#FAQs-HowdoIaddcustomerrorpages%2528likePageExpired%2529%253F 
>
>
> regards Nino
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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