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

java.lang.Object
  extended by org.codehaus.groovy.grails.web.pages.GroovyPageWritable
All Implemented Interfaces:
groovy.lang.Writable

 class GroovyPageWritable
extends Object
implements groovy.lang.Writable

An instance of groovy.lang.Writable that writes itself to the specified writer, typically the response writer

Since:
0.5

Created: Feb 23, 2007 Time: 11:36:44 AM

Author:
Graeme Rocher

Constructor Summary
GroovyPageWritable(GroovyPageMetaInfo metaInfo)
           
 
Method Summary
protected  void formulateBinding(HttpServletRequest request, HttpServletResponse response, groovy.lang.Binding binding, Writer out)
          Prepare Bindings before instantiating page.
protected  void populateViewModel(HttpServletRequest request, groovy.lang.Binding binding)
           
 void setBinding(Map binding)
          This sets any additional variables that need to be placed in the Binding of the GSP page.
 void setShowSource(boolean showSource)
          Set to true if the generated source should be output instead
protected  void writeInputStreamToResponse(InputStream in, Writer out)
          Copy all of input to output.
 Writer writeTo(Writer out)
          Writes the template to the specified Writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyPageWritable

public GroovyPageWritable(GroovyPageMetaInfo metaInfo)
Method Detail

setBinding

public void setBinding(Map binding)
This sets any additional variables that need to be placed in the Binding of the GSP page.

Parameters:
binding - The additional variables

setShowSource

public void setShowSource(boolean showSource)
Set to true if the generated source should be output instead

Parameters:
showSource - True if source output should be output

writeTo

public Writer writeTo(Writer out)
               throws IOException
Writes the template to the specified Writer

Specified by:
writeTo in interface groovy.lang.Writable
Parameters:
out - The Writer to write to, normally the HttpServletResponse
Returns:
Returns the passed Writer
Throws:
IOException

writeInputStreamToResponse

protected void writeInputStreamToResponse(InputStream in,
                                          Writer out)
                                   throws IOException
Copy all of input to output.

Parameters:
in - The input stream to writeInputStreamToResponse from
out - The output to write to
Throws:
IOException - When an error occurs writing to the response Writer

formulateBinding

protected void formulateBinding(HttpServletRequest request,
                                HttpServletResponse response,
                                groovy.lang.Binding binding,
                                Writer out)
                         throws IOException
Prepare Bindings before instantiating page.

Parameters:
request - The HttpServletRequest instance
response - The HttpServletResponse instance
out - The response out
Throws:
IOException - Thrown when an IO error occurs creating the binding

populateViewModel

protected void populateViewModel(HttpServletRequest request,
                                 groovy.lang.Binding binding)


Copyright (c) 2005-2006 The Grails project