Hi,

On Wed, Mar 4, 2015 at 6:39 AM, sameerkhanna <sameerkhanna1...@gmail.com>
wrote:

> Hi,
>
> I am facing a strange issue while trying to display a generic application
> error page whenever some exception is thrown.
>
> We recently upgraded from wicket 1.3 to wicket 6. However, it was a step by
> step upgrade for each major version. There were no issues from 1.3 to 1.4.
> However, after the upgrade to 1.5 the error page stopped getting displayed
> and what we get now is just a plain white blank page. No exception/markup
> on
> the stack trace.
>
> In my Java class that implements the IRequestCycleListener interface we
> have
> the following logic written for the onException method -
>
> public IRequestHandler onException(RequestCycle cycle, final Exception ex)
> {
>
>                 if (ex instanceof RuntimeException) {
>                         if(ex instanceof AuthorizationException || ex
> instanceof
> PageExpiredException)
>                                 return null;
>                         return (new IRequestHandler() {
>

You should return new RenderPageRequestHandler(new
PageProvider(theErrorPageInstance), preferredRedirectPolicy)


>
>                                 @Override
>                                 public void respond(IRequestCycle
> requestCycle) {
>
> ((ABC)Application.get()).getErrorMessagePage(ex);
>

This does nothing. It just creates a page instance and doesn't use it.


>                                 }
>
>                                 @Override
>                                 public void detach(IRequestCycle
> requestCycle) {
>                                         // TODO Auto-generated method stub
>
>                                 }
>
>                         });
>                 }
>                 return null;
>         }
>
> getErrorMessagePage is the method inside my application class that extends
> WebApplication and returns the error page that is to be displayed.
>
> I have made sure that there are no issues with the Java and HTML files of
> the error message page. In fact, I tried to render the error page using
> setResponse on click of a button on some other page and it does come up.
> So, I am assuming it has something to do with the way I have implemented
> IRequestHandler and IRequestCycleListener. Not quite sure on what might be
> going on.
>
> Any help will be much appreciated.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-6-Blank-page-while-trying-to-show-a-generic-error-page-onException-tp4669813.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to