org.apache.wicket
Class DefaultExceptionMapper

java.lang.Object
  extended by org.apache.wicket.DefaultExceptionMapper
All Implemented Interfaces:
IExceptionMapper

public class DefaultExceptionMapper
extends Object
implements IExceptionMapper

If an exception is thrown when a page is being rendered this mapper will decide which error page to show depending on the exception type and application configuration


Constructor Summary
DefaultExceptionMapper()
           
 
Method Summary
protected  RenderPageRequestHandler createPageRequestHandler(PageProvider pageProvider)
          Creates a RenderPageRequestHandler for the target page provided by pageProvider.
protected  Page extractCurrentPage()
           
protected  boolean isProcessingAjaxRequest()
           
 IRequestHandler map(Exception e)
           
protected  IRequestHandler mapExpectedExceptions(Exception e, Application application)
          Maps expected exceptions (i.e.
protected  IRequestHandler mapUnexpectedExceptions(Exception e, Application application)
          Maps unexpected exceptions to their corresponding IRequestHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExceptionMapper

public DefaultExceptionMapper()
Method Detail

map

public IRequestHandler map(Exception e)
Specified by:
map in interface IExceptionMapper

mapExpectedExceptions

protected IRequestHandler mapExpectedExceptions(Exception e,
                                                Application application)
Maps expected exceptions (i.e. those internally used by Wicket) to their corresponding IRequestHandler.

Parameters:
e - the current exception
application - the current application object
Returns:
the IRequestHandler for the current exception

mapUnexpectedExceptions

protected IRequestHandler mapUnexpectedExceptions(Exception e,
                                                  Application application)
Maps unexpected exceptions to their corresponding IRequestHandler.

Parameters:
e - the current exception
application - the current application object
Returns:
the IRequestHandler for the current exception

createPageRequestHandler

protected RenderPageRequestHandler createPageRequestHandler(PageProvider pageProvider)
Creates a RenderPageRequestHandler for the target page provided by pageProvider. Uses RenderPageRequestHandler.RedirectPolicy#NEVER_REDIRECT policy to preserve the original page's URL for non-Ajax requests and RenderPageRequestHandler.RedirectPolicy#AUTO_REDIRECT for AJAX requests.

Parameters:
pageProvider - the page provider for the target page
Returns:
the request handler for the target page

isProcessingAjaxRequest

protected boolean isProcessingAjaxRequest()
Returns:
true if current request is an AJAX request, false otherwise.

extractCurrentPage

protected Page extractCurrentPage()
Returns:
the page being rendered when the exception was thrown, or null if it cannot be extracted


Copyright © 2006–2015 Apache Software Foundation. All rights reserved.