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

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

Introduction

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

Prototype

public void skipToMatchingCloseTag(final ComponentTag openTag) 

Source Link

Document

Renders markup until a closing tag for openTag is reached.

Usage

From source file:org.hippoecm.frontend.service.render.AbstractRenderService.java

License:Apache License

@Override
public void onComponentTagBody(MarkupStream markupStream, final ComponentTag openTag) {
    int beginOfBodyIndex = markupStream.getCurrentIndex();
    Response response = new StringResponse();
    RequestCycle requestCycle = getRequestCycle();
    Response webResponse = requestCycle.setResponse(response);
    try {//  w ww  .ja  v a2 s .c  om
        super.onComponentTagBody(markupStream, openTag);
        webResponse.write(response.toString());
    } catch (WicketRuntimeException ex) {
        log.error("runtime plugin failure", ex);
        // this is a plugin, don't let the entire UI fail because of it failing
        markupStream.setCurrentIndex(beginOfBodyIndex);
        markupStream.skipToMatchingCloseTag(openTag);
    } finally {
        requestCycle.setResponse(webResponse);
    }
}