Grails Views with Groovy Server Pages

Grails uses Groovy Server Pages (GSP) for its view layer. If you’ve ever worked with JavaServer Pages, well, you have my sympathy, but GSP will seem familiar—only easier to work with. Grails also uses SiteMesh,[36] the page decoration framework from OpenSymphony, to assist in the page layout. SiteMesh will merge each of our .gsp files into a file called main.gsp (located in TekDays/grails-app/views/layouts. This is what gives a consistent look to all of our pages, as we saw with the dynamic scaffolding. We’ll begin our tour of the generated views with main.gsp, followed by the four views and the template generated for the TekEvent class. Then we’ll look at a couple of the other views that take advantage ...

Get Grails 2: A Quick-Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.