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 - Introduction to GORM

GORM is half the reason why I use Grails as my default choice in implementing new projects. Using it just makes implementation of business logic a breeze. Working with a database becomes so easy.
GORM is Grails' object relational mapping (ORM) implementation, which sits on top of the very popular Hibernate framework. If you are familiar with Hibernate, then you can pick up GORM in an instant. Don't worry otherwise as GORM is straightforward and easy to learn.

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 - Playing with Groovy Language

Grails is a powerful framework that makes most programming tasks short and simple. A key ingredient to achieving this is the powerful and cool language called Groovy. Before diving into learning Grails, it is worthwhile to learn basic Groovy coding tricks.

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.

Grails 2 IDE Setup

For most beginners, one of the hardest part in learning a new technology, is to setup their development environment. This tutorial is written to help new Grails programmers to prepare their Windows Development Environment.