DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Capturing Grails GSP Output
// this creates the template manually and captures the output of the GSP in a StringWriter called "writer"
def binding = [ dude : Dude.get( params.id ) ];
def writer = new StringWriter();
def template = grailsAttributes.getPagesTemplateEngine().createTemplate("/WEB-INF/grails-app/views/dude/show.gsp", servletContext, request, response);
template.make(binding).writeTo(writer);
println(writer);




