Code example for PrintWriter

Methods: closeflush

0
        return "text/xml"; 
    } 
 
    @Override 
    protected void onRender(final MarkupStream markupStream) { 
        PrintWriter writer = new PrintWriter(getResponse().getOutputStream()); 
        try { 
            getFeed().writeFeed(writer); 
            writer.flush(); 
        } catch (IOException e) { 
            throw new WicketRuntimeException("unable to construct sitemap.xml for request: " + ((WebRequest) getRequest()).getHttpServletRequest().getRemoteAddr(), e); 
        } finally { 
            writer.close(); 
        } 
    } 
 
    protected abstract SiteMapFeed getFeed(); 
 
} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE