Groovy Documentation

## org.codehaus.groovy.grails.web.pages
[Java] Class GroovyPage

    java.lang.Object
      groovy.lang.GroovyObjectSupport
          groovy.lang.Script
              org.codehaus.groovy.grails.web.pages.GroovyPage

    @SuppressWarnings("serial")
    public abstract class GroovyPage
    extends groovy.lang.Script

NOTE: Based on work done by on the GSP standalone project (https://gsp.dev.java.net/) Base class for a GroovyPage (at the moment there is nothing in here but could be useful for providing utility methods etc.

Authors:
  Troy Heninger
  Graeme Rocher
  Lari Hotari

Nested Class Summary
`static class` | `GroovyPage.ConstantClosure`

Field Summary
`static java.lang.String` | `ACTION_NAME`
`static java.lang.String` | `APPLICATION_CONTEXT`
`static java.lang.String` | `ATTRIBUTES`
`static java.lang.String` | `CODEC_OUT`
`static java.lang.String` | `CODEC_VARNAME`
`static java.lang.String` | `CONTROLLER_NAME`
`static java.lang.String` | `DEFAULT_NAMESPACE`
`protected static groovy.lang.Closure` | `EMPTY_BODY_CLOSURE`
`static java.lang.String` | `EXTENSION`
`static java.lang.String` | `FLASH`
`static java.lang.String` | `LINK_NAMESPACE`
`static java.lang.String` | `OUT`
`static java.lang.String` | `PAGE_SCOPE`
`static java.lang.String` | `PARAMS`
`static java.lang.String` | `PLUGIN_CONTEXT_PATH`
`static java.lang.String` | `REQUEST`
`static java.util.Collection` | `RESERVED_NAMES`
`static java.lang.String` | `RESPONSE`
`static java.lang.String` | `SERVLET_CONTEXT`
`static java.lang.String` | `SESSION`
`static java.lang.String` | `SUFFIX`
`static java.lang.String` | `TEMPLATE_NAMESPACE`
`static java.lang.String` | `WEB_REQUEST`

Method Summary
`java.lang.Object` | `GroovyPage()`
`static java.lang.Object` | `captureTagOutput(TagLibraryLookup gspTagLibraryLookup, java.lang.String namespace, java.lang.String tagName, java.util.Map attrs, java.lang.Object body, GrailsWebRequest webRequest)`
`void` | `cleanup()`
`protected groovy.lang.Closure` | `createClosureForHtmlPart(int partNumber)`
`static groovy.lang.Closure` | `createOutputCapturingClosure(java.lang.Object wrappedInstance, java.lang.Object body1, GrailsWebRequest webRequest, boolean preferSubChunkWhenWritingToOtherBuffer)`
`java.lang.Object` | `evaluate(java.lang.String exprText, int lineNumber, java.lang.Object outerIt, groovy.lang.Closure evaluator)` In the development environment this method is used to evaluate expressions and improve error reporting
`java.io.Writer` | `getCodecOut()`
`java.lang.String` | `getGroovyPageFileName()`
`String[]` | `getHtmlParts()`
`java.io.Writer` | `getOut()`
`GroovyPageOutputStack` | `getOutputStack()`
`java.lang.String` | `getPluginContextPath()`
`java.lang.Object` | `getProperty(java.lang.String property)`
`protected void` | `init()`
`void` | `initRun(java.io.Writer target, GrailsWebRequest grailsWebRequest, java.lang.Class codecClass)`
`java.lang.Object` | `invokeMethod(java.lang.String methodName, java.lang.Object args)` Allows invoking of taglibs as method calls with simple bodies.
`void` | `invokeTag(java.lang.String tagName, java.util.Map attrs, groovy.lang.Closure body)` Attempts to invokes a dynamic tag
`void` | `invokeTag(java.lang.String tagName, java.lang.String tagNamespace, java.util.Map attrs, groovy.lang.Closure body)` Attempts to invokes a dynamic tag
`void` | `invokeTag(java.lang.String tagName, java.lang.String tagNamespace, int lineNumber, java.util.Map attrs, groovy.lang.Closure body)`
`static boolean` | `isReservedName(java.lang.String name)` Return whether the given name cannot be used within the binding of a GSP
`void` | `printHtmlPart(int partNumber)`
`void` | `registerSitemeshPreprocessMode(HttpServletRequest request)`
`void` | `setGspTagLibraryLookup(TagLibraryLookup gspTagLibraryLookup)` Sets the GSP tag library lookup class
`void` | `setHtmlParts(String[] htmlParts)`
`void` | `setJspTagLibraryResolver(TagLibraryResolver jspTagLibraryResolver)` Sets the JSP tag library resolver to use to resolve JSP tags
`void` | `setJspTags(java.util.Map jspTags)` Sets the JSP tags used by this GroovyPage instance
`void` | `setOut(java.io.Writer newWriter)`

Methods inherited from class groovy.lang.Script

groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#wait(long, int), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll()

Methods inherited from class groovy.lang.GroovyObjectSupport

groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### ACTION_NAME

    public static final java.lang.String ACTION_NAME

### APPLICATION_CONTEXT

    public static final java.lang.String APPLICATION_CONTEXT

### ATTRIBUTES

    public static final java.lang.String ATTRIBUTES

### CODEC_OUT

    public static final java.lang.String CODEC_OUT

### CODEC_VARNAME

    public static final java.lang.String CODEC_VARNAME

### CONTROLLER_NAME

    public static final java.lang.String CONTROLLER_NAME

### DEFAULT_NAMESPACE

    public static final java.lang.String DEFAULT_NAMESPACE

### EMPTY_BODY_CLOSURE

    protected static final groovy.lang.Closure EMPTY_BODY_CLOSURE

### EXTENSION

    public static final java.lang.String EXTENSION

### FLASH

    public static final java.lang.String FLASH

### LINK_NAMESPACE

    public static final java.lang.String LINK_NAMESPACE

### OUT

    public static final java.lang.String OUT

### PAGE_SCOPE

    public static final java.lang.String PAGE_SCOPE

### PARAMS

    public static final java.lang.String PARAMS

### PLUGIN_CONTEXT_PATH

    public static final java.lang.String PLUGIN_CONTEXT_PATH

### REQUEST

    public static final java.lang.String REQUEST

### RESERVED_NAMES

    public static final java.util.Collection RESERVED_NAMES

### RESPONSE

    public static final java.lang.String RESPONSE

### SERVLET_CONTEXT

    public static final java.lang.String SERVLET_CONTEXT

### SESSION

    public static final java.lang.String SESSION

### SUFFIX

    public static final java.lang.String SUFFIX

### TEMPLATE_NAMESPACE

    public static final java.lang.String TEMPLATE_NAMESPACE

### WEB_REQUEST

    public static final java.lang.String WEB_REQUEST

Method Detail

### GroovyPage

    public java.lang.Object GroovyPage()

### captureTagOutput

    @SuppressWarnings("rawtypes")
    public static java.lang.Object captureTagOutput(TagLibraryLookup gspTagLibraryLookup, java.lang.String namespace, java.lang.String tagName, java.util.Map attrs, java.lang.Object body, GrailsWebRequest webRequest)

### cleanup

    public void cleanup()

### createClosureForHtmlPart

    protected groovy.lang.Closure createClosureForHtmlPart(int partNumber)

### createOutputCapturingClosure

    public static groovy.lang.Closure createOutputCapturingClosure(java.lang.Object wrappedInstance, java.lang.Object body1, GrailsWebRequest webRequest, boolean preferSubChunkWhenWritingToOtherBuffer)

### evaluate

    public java.lang.Object evaluate(java.lang.String exprText, int lineNumber, java.lang.Object outerIt, groovy.lang.Closure evaluator)

  In the development environment this method is used to evaluate expressions and improve error reporting
  Parameters:
    `exprText` - The expression text
    `lineNumber` - The line number
    `outerIt` - The other reference to the variable 'it'
    `evaluator` - The expression evaluator
  Returns:
    The result

### getCodecOut

    public java.io.Writer getCodecOut()

### getGroovyPageFileName

    public java.lang.String getGroovyPageFileName()

### getHtmlParts

    public String[] getHtmlParts()

### getOut

    public java.io.Writer getOut()

### getOutputStack

    public GroovyPageOutputStack getOutputStack()

### getPluginContextPath

    public java.lang.String getPluginContextPath()

### getProperty

    @Override
    public java.lang.Object getProperty(java.lang.String property)

### init

    protected void init()

### initRun

    @SuppressWarnings("rawtypes")
    public void initRun(java.io.Writer target, GrailsWebRequest grailsWebRequest, java.lang.Class codecClass)

### invokeMethod

    @SuppressWarnings("rawtypes")
    @Override
    public java.lang.Object invokeMethod(java.lang.String methodName, java.lang.Object args)

  Allows invoking of taglibs as method calls with simple bodies. The bodies should only contain text
  Parameters:
    `methodName` - The methodName of the tag to call or the methodName of a method on GroovPage
    `args` - The Arguments
  Returns:
    The result of the invocation

### invokeTag

    @SuppressWarnings("rawtypes")
    public void invokeTag(java.lang.String tagName, java.util.Map attrs, groovy.lang.Closure body)

  Attempts to invokes a dynamic tag
  Parameters:
    `tagName` - The name of the tag
    `attrs` - The tags attributes
    `body` - The body of the tag as a closure

### invokeTag

    @SuppressWarnings("rawtypes")
    public void invokeTag(java.lang.String tagName, java.lang.String tagNamespace, java.util.Map attrs, groovy.lang.Closure body)

  Attempts to invokes a dynamic tag
  Parameters:
    `tagName` - The name of the tag
    `tagNamespace` - The taglib's namespace
    `attrs` - The tags attributes
    `body` - The body of the tag as a closure

### invokeTag

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public void invokeTag(java.lang.String tagName, java.lang.String tagNamespace, int lineNumber, java.util.Map attrs, groovy.lang.Closure body)

### isReservedName

    public static boolean isReservedName(java.lang.String name)

  Return whether the given name cannot be used within the binding of a GSP
  Parameters:
    `name` - True if it can't
  Returns:
    A boolean true or false

### printHtmlPart

    public final void printHtmlPart(int partNumber)

### registerSitemeshPreprocessMode

    public void registerSitemeshPreprocessMode(HttpServletRequest request)

### setGspTagLibraryLookup

    public void setGspTagLibraryLookup(TagLibraryLookup gspTagLibraryLookup)

  Sets the GSP tag library lookup class
  Parameters:
    `gspTagLibraryLookup` - The class used to lookup a GSP tag library

### setHtmlParts

    public void setHtmlParts(String[] htmlParts)

### setJspTagLibraryResolver

    public void setJspTagLibraryResolver(TagLibraryResolver jspTagLibraryResolver)

  Sets the JSP tag library resolver to use to resolve JSP tags
  Parameters:
    `jspTagLibraryResolver` - The JSP tag resolve

### setJspTags

    @SuppressWarnings("rawtypes")
    public void setJspTags(java.util.Map jspTags)

  Sets the JSP tags used by this GroovyPage instance
  Parameters:
    `jspTags` - The JSP tags used

### setOut

    public void setOut(@SuppressWarnings("unused") java.io.Writer newWriter)

Groovy Documentation