(Quick Reference)



A reference to the binding of the GSP that the tag library is being executed within. Allows access to variables set with the set tag and those passed to the page from the controller model.


class BookTagLib {

   def parent = { attrs, body ->
       pageScope.parent = "John"
       out << body()

   def child = { attrs, body ->
       out << "My parent is ${pageScope.parent}"
    <g:child /> // Outputs "My parent is John"


The pageScope variable contains a reference to the underlying model being manipulated by the page. It can also be used to pass variables from parent to child tags.