Grails Cookbook - A collection of tutorials and examples

Grails Tutorial for Beginners - Display Data from the Database

The most common thing we want to do in Grails is to read data from the database and display it to the user. This post is a simple walk-through on how to accomplish this.

Grails Tutorial for Beginners - Layout Templates

When coding screens, there are many elements that are common and repetitive. Usually the header, footer, and sidebars stays the same and only the content at the middle of the screen that change. The best approach is to have your GSP page contain only the specific business content, and have the repeating content re-factored outside. Grails supports layout templates for this particular purpose.

Grails Tutorial for Beginners - Basic Groovy Server Pages (GSP)

Groovy Server Pages (or GSP) is the default presentation technology for rendering views in Grails. It is very similar to JSP where you can easily combine static and dynamic contents in your output. The Grails framework have made it very easy to use yet powerful enough for most use cases.

Grails Tutorial for Beginners - Starting with Controllers

When learning Grails or any other framework, I recommend to study each components separately first. Rather than tackling multiple topics at the same time. For Grails beginners, I recommend to start with controllers. This is one of the simplest to understand and you can see results right away!

Grails Tutorial for Beginners - Model View Controller (MVC) Pattern

Before going through your journey in learning Grails, it is important to understand the MVC Pattern. Most web application framework uses this architecture to help make clean and manageable projects. It is surprisingly simple and easy to learn too.