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 Object implements org.apache.wicket.request.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 andapplication configuration
-
-
Constructor Summary
Constructors Constructor Description DefaultExceptionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RenderPageRequestHandler
createPageRequestHandler(PageProvider pageProvider)
Creates aRenderPageRequestHandler
for the target page provided bypageProvider
.protected Page
extractCurrentPage()
protected boolean
isProcessingAjaxRequest()
org.apache.wicket.request.IRequestHandler
map(Exception e)
protected org.apache.wicket.request.IRequestHandler
mapExpectedExceptions(Exception e, Application application)
Maps expected exceptions (i.e.protected org.apache.wicket.request.IRequestHandler
mapUnexpectedExceptions(Exception e, Application application)
Maps unexpected exceptions to their correspondingIRequestHandler
.
-
-
-
Constructor Detail
-
DefaultExceptionMapper
public DefaultExceptionMapper()
-
-
Method Detail
-
map
public org.apache.wicket.request.IRequestHandler map(Exception e)
- Specified by:
map
in interfaceorg.apache.wicket.request.IExceptionMapper
-
mapExpectedExceptions
protected org.apache.wicket.request.IRequestHandler mapExpectedExceptions(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
IRequestHandler
for the current exception
-
mapUnexpectedExceptions
protected org.apache.wicket.request.IRequestHandler mapUnexpectedExceptions(Exception e, Application application)
Maps unexpected exceptions to their correspondingIRequestHandler
.- Parameters:
e
- the current exceptionapplication
- the current application object- Returns:
- the
IRequestHandler
for the current exception
-
createPageRequestHandler
protected RenderPageRequestHandler createPageRequestHandler(PageProvider pageProvider)
Creates aRenderPageRequestHandler
for the target page provided bypageProvider
. UsesRenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT
policy to preserve the original page's URL for non-Ajax requests andRenderPageRequestHandler.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
-
-