Class ExceptionSettings
- java.lang.Object
-
- org.apache.wicket.settings.ExceptionSettings
-
public class ExceptionSettings extends Object
Settings class for configuring exception handling related settings.unexpectedExceptionDisplay (defaults to SHOW_EXCEPTION_PAGE) - Determines how exceptions are displayed to the developer or user
throwExceptionOnMissingResource (defaults to true) - Set to true to throw a runtime exception if a required string resource is not found. Set to false to return the requested resource key surrounded by pairs of question mark characters (e.g. "??missingKey??")
- Author:
- Jonathan Locke, Chris Turner, Eelco Hillenius, Juergen Donnerstag, Johan Compagner, Igor Vaynberg (ivaynberg), Martijn Dashorst, James Carman
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExceptionSettings.AjaxErrorStrategy
How to handle errors while processing an Ajax requeststatic class
ExceptionSettings.NotRenderableErrorStrategy
A strategy defining what to do when a component that will not render its markup tag (because ofsetRenderBodyOnly(true)
or used with <wicket:xyz>) is also asked to output a markupid
orplaceholder tag
static class
ExceptionSettings.ThreadDumpStrategy
Which threads' stacktrace to dump when a page lock timeout occursstatic class
ExceptionSettings.UnexpectedExceptionDisplay
Enumerated type for different ways of displaying unexpected exceptions.
-
Field Summary
Fields Modifier and Type Field Description static ExceptionSettings.UnexpectedExceptionDisplay
SHOW_EXCEPTION_PAGE
Indicates that an exception page appropriate to development should be shown when an unexpected exception is thrown.static ExceptionSettings.UnexpectedExceptionDisplay
SHOW_INTERNAL_ERROR_PAGE
Indicates a generic internal error page should be shown when an unexpected exception is thrown.static ExceptionSettings.UnexpectedExceptionDisplay
SHOW_NO_EXCEPTION_PAGE
Indicates that no exception page should be shown when an unexpected exception is thrown.
-
Constructor Summary
Constructors Constructor Description ExceptionSettings()
-
Method Summary
-
-
-
Field Detail
-
SHOW_EXCEPTION_PAGE
public static final ExceptionSettings.UnexpectedExceptionDisplay SHOW_EXCEPTION_PAGE
Indicates that an exception page appropriate to development should be shown when an unexpected exception is thrown.
-
SHOW_INTERNAL_ERROR_PAGE
public static final ExceptionSettings.UnexpectedExceptionDisplay SHOW_INTERNAL_ERROR_PAGE
Indicates a generic internal error page should be shown when an unexpected exception is thrown.
-
SHOW_NO_EXCEPTION_PAGE
public static final ExceptionSettings.UnexpectedExceptionDisplay SHOW_NO_EXCEPTION_PAGE
Indicates that no exception page should be shown when an unexpected exception is thrown.
-
-
Constructor Detail
-
ExceptionSettings
public ExceptionSettings()
-
-
Method Detail
-
getUnexpectedExceptionDisplay
public ExceptionSettings.UnexpectedExceptionDisplay getUnexpectedExceptionDisplay()
- Returns:
- Returns the unexpectedExceptionDisplay.
-
setUnexpectedExceptionDisplay
public ExceptionSettings setUnexpectedExceptionDisplay(ExceptionSettings.UnexpectedExceptionDisplay unexpectedExceptionDisplay)
The exception display type determines how the framework displays exceptions to you as a developer or user.The default value for exception display type is SHOW_EXCEPTION_PAGE. When this value is set and an unhandled runtime exception is thrown by a page, a redirect to a helpful exception display page will occur.
This is a developer feature, however, and you may want to instead show an internal error page without developer details that allows a user to start over at the application's home page. This can be accomplished by setting the exception display type to SHOW_INTERNAL_ERROR_PAGE.
Finally, if you are having trouble with the exception display pages themselves, you can disable exception displaying entirely with the value SHOW_NO_EXCEPTION_PAGE. This will cause the framework to re-throw any unhandled runtime exceptions after wrapping them in a ServletException wrapper.
- Parameters:
unexpectedExceptionDisplay
- The unexpectedExceptionDisplay to set.- Returns:
this
object for chaining
-
getAjaxErrorHandlingStrategy
public ExceptionSettings.AjaxErrorStrategy getAjaxErrorHandlingStrategy()
- Returns:
- strategy used to handle errors during Ajax request processing
-
setAjaxErrorHandlingStrategy
public ExceptionSettings setAjaxErrorHandlingStrategy(ExceptionSettings.AjaxErrorStrategy errorHandlingStrategyDuringAjaxRequests)
Sets strategy used to handle errors during Ajax request processing- Parameters:
errorHandlingStrategyDuringAjaxRequests
-- Returns:
this
object for chaining
-
setThreadDumpStrategy
public ExceptionSettings setThreadDumpStrategy(ExceptionSettings.ThreadDumpStrategy strategy)
Sets the strategy to use for dumping stack traces of live threads in the JVM.- Parameters:
strategy
-- Returns:
this
object for chaining
-
getThreadDumpStrategy
public ExceptionSettings.ThreadDumpStrategy getThreadDumpStrategy()
- Returns:
- strategy to use for dumping stack traces of live threads in the JVM.
-
getNotRenderableErrorStrategy
public ExceptionSettings.NotRenderableErrorStrategy getNotRenderableErrorStrategy()
-
setNotRenderableErrorStrategy
public void setNotRenderableErrorStrategy(ExceptionSettings.NotRenderableErrorStrategy notRenderableErrorStrategy)
-
-