Never been to DZone Snippets before?

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

About this user

graham o'regan http://www.ellisonbrookes.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

capturing grails GSP output

// this creates the template manually and captures the output of the GSP in a StringWriter called "writer"

   1  
   2  def binding = [ dude : Dude.get( params.id ) ];  
   3  def writer = new StringWriter();
   4  def template = grailsAttributes.getPagesTemplateEngine().createTemplate("/WEB-INF/grails-app/views/dude/show.gsp", servletContext, request, response);
   5  template.make(binding).writeTo(writer);
   6  println(writer);
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS