org.codehaus.groovy.grails.web.pages
Class GSPResponseWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.codehaus.groovy.grails.web.util.GrailsPrintWriter
              extended by org.codehaus.groovy.grails.web.pages.GSPResponseWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class GSPResponseWriter
extends GrailsPrintWriter

NOTE: Based on work done by on the GSP standalone project (https://gsp.dev.java.net/) A buffered writer that won't commit the response until the buffer has reached the high water mark, or until flush() or close() is called. Performance optimizations by Lari Hotari, 13.03.2009 Calculating the Content-Length has been disabled by default since Jetty ignores it (uses Chunked mode anyways). Content-Length mode can be enabled with -DGSPResponseWriter.enableContentLength=true system property.

Author:
Troy Heninger, Graeme Rocher, Lari Hotari, Sagire Software Oy Date: Jan 10, 2004

Field Summary
 
Fields inherited from class org.codehaus.groovy.grails.web.util.GrailsPrintWriter
out, trouble
 
Fields inherited from class java.io.Writer
lock
 
Method Summary
 void close()
          Close the stream.
static GSPResponseWriter getInstance(ServletResponse response, int max)
          Static factory methdirectWritingod to create the writer.
static GSPResponseWriter getInstance(Writer target, int max)
          Static factory method to create the writer.
 
Methods inherited from class org.codehaus.groovy.grails.web.util.GrailsPrintWriter
append, append, append, checkError, clone, flush, getFinalTarget, getOut, handleIOException, isFinalTargetHere, leftShift, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setFinalTargetHere, write, write, write, write, write
 
Methods inherited from class java.io.PrintWriter
format, format, printf, printf, setError
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GSPResponseWriter getInstance(ServletResponse response,
                                            int max)
Static factory methdirectWritingod to create the writer.

Parameters:
response -
max -
Returns:
A GSPResponseWriter instance

getInstance

public static GSPResponseWriter getInstance(Writer target,
                                            int max)
Static factory method to create the writer.

Parameters:
target - The target writer to write too
max -
Returns:
A GSPResponseWriter instance

close

public void close()
Close the stream.

Specified by:
close in interface Closeable
Overrides:
close in class PrintWriter
See Also:
GrailsPrintWriter.checkError()


Copyright (c) 2005-2009 The Grails project