Example usage for org.apache.wicket.protocol.http BufferedWebResponse reset

List of usage examples for org.apache.wicket.protocol.http BufferedWebResponse reset

Introduction

In this page you can find the example usage for org.apache.wicket.protocol.http BufferedWebResponse reset.

Prototype

@Override
    public void reset() 

Source Link

Usage

From source file:name.martingeisse.wicket.util.ResponseFlusher.java

License:Open Source License

@Override
protected void onComponentTag(ComponentTag tag) {
    super.onComponentTag(tag);

    /*//w  ww .j a va2  s . c  om
     * Flush early to allow the browser to load satellite files while the server
     * is performing the search. Flushing has been tested to work (using a
     * delay after flushing) and has the obvious effect that a subsequent
     * exception will print the stack trace / page expired below the flushed
     * HEAD, so use the early flusher with care!
     */
    Response response = RequestCycle.get().getResponse();
    if (response instanceof BufferedWebResponse) {
        BufferedWebResponse bufferedWebResponse = (BufferedWebResponse) response;
        // the following lines are Wicketese for "flush"
        bufferedWebResponse.close();
        bufferedWebResponse.reset();
        try {
            ((HttpServletResponse) bufferedWebResponse.getContainerResponse()).flushBuffer();
        } catch (IOException e) {
        }
    }

}