public ExceptionErrorPage(final Throwable throwable, final Page page)
{
this.throwable = throwable;
// Add exception label
add(new MultiLineLabel("exception", getErrorMessage(throwable)));
add(new MultiLineLabel("stacktrace", getStackTrace(throwable)));
// Get values
String resource = "";
String markup = "";
MarkupStream markupStream = null;
if (throwable instanceof MarkupException)
{
markupStream = ((MarkupException)throwable).getMarkupStream();
if (markupStream != null)
{
markup = markupStream.toHtmlDebugString();
resource = markupStream.getResource().toString();
}
}
// Create markup label
final MultiLineLabel markupLabel = new MultiLineLabel("markup", markup);
markupLabel.setEscapeModelStrings(false);
// Add container with markup highlighted
final WebMarkupContainer markupHighlight = new WebMarkupContainer("markupHighlight");
markupHighlight.add(markupLabel);