Example usage for org.apache.wicket.request.component IRequestablePage renderPage

List of usage examples for org.apache.wicket.request.component IRequestablePage renderPage

Introduction

In this page you can find the example usage for org.apache.wicket.request.component IRequestablePage renderPage.

Prototype

void renderPage();

Source Link

Document

Renders the page

Usage

From source file:org.xaloon.wicket.component.render.StringWebPageRenderer.java

License:Apache License

/**
 * @param requestCycle/*  w  w w .j  av a  2  s  .  c  o m*/
 * @return rendered page as html code
 */
public String renderToString(RequestCycle requestCycle) {
    // get the page before checking for a scheduled request handler because
    // the page may call setResponsePage in its constructor
    IRequestablePage requestablePage = getPage();

    // keep the original response
    final WebResponse originalResponse = (WebResponse) requestCycle.getResponse();

    // buffered web response for page
    BufferedWebResponse response = new BufferedWebResponse(originalResponse);

    requestCycle.setResponse(response);
    requestablePage.renderPage();

    return response.toString();
}