groovy/groovy-core — pull request #36 by kousen (2012-03-02 23:30:38+00:00)
Title: added json as implicit variable of type JsonBuilder to groovlets

groovlets have long had an implicit object of type MarkupBuilder called html, which is useful for writing out XML representations of objects. A similar object called json, of type groovy.json.JsonBuilder, was added to ServletBinding so that it is available in groovlets.

Unlike MarkupBuilder, JsonBuilder only serializes its output but does not write it to the output writer. Expected usage, therefore, will be to use the builder and then use "out << json" or "print json" to write the result to the response.

https://jira.codehaus.org/browse/GROOVY-5341