Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt
hiddentrue
  • HTTP, Non-HTTP, and Displaying


How do I add custom error pages?

...

Code Block
// show internal error page rather than default developer page
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettingsExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);

...

Code Block
// also see AbortWithWebErrorCodeException and AbortWithHttpStatusException
throw new AbortWithHttpStatusException(404, true);

For wicket 6 and beyond:

Code Block

throw new AbortWithHttpErrorCodeException(404, "Some message");

Overriding All Error Pages for RuntimeException

...