Package org.apache.wicket
Class DefaultExceptionMapper
- java.lang.Object
-
- org.apache.wicket.DefaultExceptionMapper
-
- All Implemented Interfaces:
org.apache.wicket.request.IExceptionMapper
public class DefaultExceptionMapper extends java.lang.Object implements org.apache.wicket.request.IExceptionMapperIf an exception is thrown when a page is being rendered this mapper will decide which error page to show depending on the exception type andapplication configuration
-
-
Constructor Summary
Constructors Constructor Description DefaultExceptionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RenderPageRequestHandlercreatePageRequestHandler(PageProvider pageProvider)Creates aRenderPageRequestHandlerfor the target page provided bypageProvider.protected PageextractCurrentPage()protected booleanisProcessingAjaxRequest()org.apache.wicket.request.IRequestHandlermap(java.lang.Exception e)protected org.apache.wicket.request.IRequestHandlermapExpectedExceptions(java.lang.Exception e, Application application)Maps expected exceptions (i.e.protected org.apache.wicket.request.IRequestHandlermapUnexpectedExceptions(java.lang.Exception e, Application application)Maps unexpected exceptions to their correspondingIRequestHandler.
-
-
-
Method Detail
-
map
public org.apache.wicket.request.IRequestHandler map(java.lang.Exception e)
- Specified by:
mapin interfaceorg.apache.wicket.request.IExceptionMapper
-
mapExpectedExceptions
protected org.apache.wicket.request.IRequestHandler mapExpectedExceptions(java.lang.Exception e, Application application)Maps expected exceptions (i.e. those internally used by Wicket) to their correspondingIRequestHandler.- Parameters:
e- the current exceptionapplication- the current application object- Returns:
- the
IRequestHandlerfor the current exception
-
mapUnexpectedExceptions
protected org.apache.wicket.request.IRequestHandler mapUnexpectedExceptions(java.lang.Exception e, Application application)Maps unexpected exceptions to their correspondingIRequestHandler.- Parameters:
e- the current exceptionapplication- the current application object- Returns:
- the
IRequestHandlerfor the current exception
-
createPageRequestHandler
protected RenderPageRequestHandler createPageRequestHandler(PageProvider pageProvider)
Creates aRenderPageRequestHandlerfor the target page provided bypageProvider. UsesRenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECTpolicy to preserve the original page's URL for non-Ajax requests andRenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECTfor 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
nullif it cannot be extracted
-
-