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.GrailsPrintWriterAdapter
              extended by org.codehaus.groovy.grails.web.pages.GSPResponseWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable, GrailsWrappedWriter

public class GSPResponseWriter
extends GrailsPrintWriterAdapter

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.


Field Summary
static boolean AUTOFLUSH_ENABLED
           
static boolean BUFFERING_ENABLED
           
static boolean CONTENT_LENGTH_COUNTING_ENABLED
           
protected static org.apache.commons.logging.Log LOG
           
 
Fields inherited from class org.codehaus.groovy.grails.web.util.GrailsPrintWriterAdapter
target
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Method Summary
 void close()
          Close the stream.
static GSPResponseWriter getInstance(javax.servlet.ServletResponse response)
           
 
Methods inherited from class org.codehaus.groovy.grails.web.util.GrailsPrintWriterAdapter
append, append, append, append, append, checkError, flush, getOut, getTarget, handleIOException, isAllowUnwrappingOut, isTrouble, isUsed, leftShift, leftShift, leftShift, markUsed, plus, print, print, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, println, resetUsed, setError, setTarget, setUsed, unwrap, write, write, write, write, write, write, write
 
Methods inherited from class java.io.PrintWriter
clearError, format, format, printf, printf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

CONTENT_LENGTH_COUNTING_ENABLED

public static final boolean CONTENT_LENGTH_COUNTING_ENABLED

BUFFERING_ENABLED

public static final boolean BUFFERING_ENABLED

AUTOFLUSH_ENABLED

public static final boolean AUTOFLUSH_ENABLED
Method Detail

getInstance

public static GSPResponseWriter getInstance(javax.servlet.ServletResponse response)

close

public void close()
Close the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class GrailsPrintWriterAdapter
See Also:
GrailsPrintWriterAdapter.checkError()