Example usage for org.apache.wicket.markup MarkupStream getResource

List of usage examples for org.apache.wicket.markup MarkupStream getResource

Introduction

In this page you can find the example usage for org.apache.wicket.markup MarkupStream getResource.

Prototype

public IResourceStream getResource() 

Source Link

Usage

From source file:eu.uqasar.web.pages.errors.ErrorPage.java

License:Apache License

private String getMarkUp(final Throwable throwable) {
    String resource = "";
    String markup = "";
    MarkupStream markupStream;
    if (throwable instanceof MarkupException) {
        markupStream = ((MarkupException) throwable).getMarkupStream();

        if (markupStream != null) {
            markup = markupStream.toHtmlDebugString();
            resource = markupStream.getResource().toString();
        }/*from w ww.ja v  a2s  .c o  m*/
    }
    String markupStr = "Resource: " + (resource.isEmpty() ? "[No Resource]" : resource);
    markupStr += "\nMarkup: " + (markup.isEmpty() ? "[No Markup]" : markup);
    return markupStr;
}