Grails: Returning parameters from a taglib

grails, taglib

Solution

from the top of the documentation http://grails.org/doc/latest/guide/theWebLayer.html#tagReturnValue

class ObjectReturningTagLib {

  static returnObjectForTags = ['content']

  def content = { attrs, body ->
    someValue()
  }
}

Problem

How do I return values from a taglib that has been called in a controller action such that it automatically retains the full type structure of the values setup in the taglib? I can use the `out <<` approach but this returns strings or array of strings. I have tried to use a `[]` mapping as used transfer a set of values at the end of an action to its view. I have also tried a `return` statement again unsuccessfully - besides I need to return more than one set of values. -mike

Original source