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

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Script
          extended by org.codehaus.groovy.grails.web.pages.GroovyPage
All Implemented Interfaces:
groovy.lang.GroovyObject

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.

Author:
Troy Heninger, Graeme Rocher Date: Jan 10, 2004

Field Summary
static String APPLICATION_CONTEXT
           
static String ATTRIBUTES
           
static String DEFAULT_NAMESPACE
           
static String EXTENSION
           
static String FLASH
           
static String OUT
           
static String PAGE_SCOPE
           
static String PARAMS
           
static String PLUGIN_CONTEXT_PATH
           
static String REQUEST
           
static String RESPONSE
           
static String SERVLET_CONTEXT
           
static String SESSION
           
static String WEB_REQUEST
           
 
Constructor Summary
GroovyPage()
           
 
Method Summary
static String captureTagOutput(groovy.lang.GroovyObject tagLib, String methodName, Map attrs, Object body, GrailsWebRequest webRequest, BeanWrapper bean)
           
static String fromHtml(String text)
          Convert from HTML to Unicode text.
 Object getProperty(String property)
           
 Object invokeMethod(String methodName, Object args)
          Allows invoking of taglibs as method calls with simple bodies.
 void invokeTag(String tagName, Map attrs, groovy.lang.Closure body)
          Attempts to invokes a dynamic tag
 void invokeTag(String tagName, String tagNamespace, Map attrs, groovy.lang.Closure body)
          Attempts to invokes a dynamic tag
 
Methods inherited from class groovy.lang.Script
evaluate, evaluate, getBinding, print, println, println, run, run, setBinding, setProperty
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST

public static final String REQUEST
See Also:
Constant Field Values

SERVLET_CONTEXT

public static final String SERVLET_CONTEXT
See Also:
Constant Field Values

RESPONSE

public static final String RESPONSE
See Also:
Constant Field Values

OUT

public static final String OUT
See Also:
Constant Field Values

ATTRIBUTES

public static final String ATTRIBUTES
See Also:
Constant Field Values

APPLICATION_CONTEXT

public static final String APPLICATION_CONTEXT
See Also:
Constant Field Values

SESSION

public static final String SESSION
See Also:
Constant Field Values

PARAMS

public static final String PARAMS
See Also:
Constant Field Values

FLASH

public static final String FLASH
See Also:
Constant Field Values

PLUGIN_CONTEXT_PATH

public static final String PLUGIN_CONTEXT_PATH
See Also:
Constant Field Values

EXTENSION

public static final String EXTENSION
See Also:
Constant Field Values

WEB_REQUEST

public static final String WEB_REQUEST
See Also:
Constant Field Values

DEFAULT_NAMESPACE

public static final String DEFAULT_NAMESPACE
See Also:
Constant Field Values

PAGE_SCOPE

public static final String PAGE_SCOPE
See Also:
Constant Field Values
Constructor Detail

GroovyPage

public GroovyPage()
Method Detail

fromHtml

public static String fromHtml(String text)
Convert from HTML to Unicode text. This function converts many of the encoded HTML characters to normal Unicode text. Example: &lt; to <.


getProperty

public Object getProperty(String property)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class groovy.lang.Script

invokeTag

public void invokeTag(String tagName,
                      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

public void invokeTag(String tagName,
                      String tagNamespace,
                      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

invokeMethod

public Object invokeMethod(String methodName,
                           Object args)
Allows invoking of taglibs as method calls with simple bodies. The bodies should only contain text

Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class groovy.lang.Script
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

captureTagOutput

public static String captureTagOutput(groovy.lang.GroovyObject tagLib,
                                      String methodName,
                                      Map attrs,
                                      Object body,
                                      GrailsWebRequest webRequest,
                                      BeanWrapper bean)


Copyright (c) 2005-2006 The Grails project