Package org.grails.buffer

Examples of org.grails.buffer.GrailsPrintWriter


        GrailsWebRequest webRequest = bindMockHttpRequest();

        // Initialize out and codecOut as it is done in GroovyPage.initRun
        OutputEncodingStack outputStack = OutputEncodingStack.currentStack(true, target, false, true);
        GrailsPrintWriter out = outputStack.getOutWriter();
        webRequest.setOut(out);
        GrailsPrintWriter codecOut = new CodecPrintWriter(out, getEncoder(new MockGrailsApplication(), CodecWithClosureProperties.class), registry);

        // print some output
        codecOut.print("hola");
        codecOut.flush();
        out.print("1");
        out.print("2");
        out.print("3");

        // similar as taglib call
        FastStringWriter bufferWriter=new FastStringWriter();
        GrailsPrintWriter out2=new GrailsPrintWriter(bufferWriter);
        outputStack.push(out2);
        out.print("4");
        codecOut.print("A");
        codecOut.flush();
        outputStack.pop();
View Full Code Here

TOP

Related Classes of org.grails.buffer.GrailsPrintWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.