10.11.3 Using GSP to Customize Rendering

You can also customize rendering on a per action basis using Groovy Server Pages (GSP). For example given the show action mentioned previously:

  1. def show(Book book) {
  2. respond book
  3. }

You could supply a show.xml.gsp file to customize the rendering of the XML:

  1. <%@page contentType="application/xml"%>
  2. <book id="${book.id}" title="${book.title}"/>