Grails Cookbook - A collection of tutorials and examples

Groovy Tokenize

We will show code snippet examples on how to tokenize a String in Groovy.

Groovy GString Examples

GString represents a String that may be used for template like functionality. It contains embedded values that can be evaluated lazily. For example, the GString "Hi ${name}" can be evaluated giving a value to name. Below are some examples.

Groovy Trim Examples

We will show code snippet examples on how to perform String trim in Groovy.

Grails 3 Project Structure Tutorial

If you are new to Grails development, this tutorial will discuss the structure of a Grails 3 application. There has been changes in the underlying technology behind Grails 3 and it would be a good start to understand the different sections, regardless if you have background to previous releases.

Groovy List Remove

This is a short snippet on how remove items from a Groovy List.

Groovy Deduplicate List

Here is a short code snippet on how to remove duplicates from a list.

Groovy List Contains

Here is a short code snippet on how to check if a list contains an item.

Groovy Create List

Here is a short code snippet on how to create a list in Groovy.

Grails 3 IDE Setup

This guide will show how to setup your Windows Environment for Grails 3 development. The goal is to help beginners get started by overcoming challenges of doing the initial setup and installation of required software. This tutorial will also show the optional step of installing an IDE such as Eclipse, NetBeans, IntelliJ IDEA, and Notepad++.

Grails formatNumber Tag Example

The Grails' <g:formatNumber> tag can be used inside GSPs to control the format when displaying numerical values. This is based onJava's DecimalFormat or the JSTL formatNumber tag. Below are some examples on how to use this tag.