Grails Cookbook - A collection of tutorials and examples

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.

Setup Grails 3 Windows Development Environment

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.

Groovy Sort Information in XML Document

Given an XML, we can modify it's contents by sorting the entries based on some criteria. Below is a simple code example on how to do that.

Groovy Edit/Modify XML Examples

Sometimes, it is not enough to parse or create XML documents. There are times when we need to edit an XML information for further processing. Below are examples on how to modify or edit existing XML document.

Groovy Create XML Document Examples

In previous examples, we show how to parse XML documents using XmlSlurper and XmlParser. This post will show the opposite. We give examples on how to create XML documents.

Groovy XmlParser Examples for Parsing XML

Parsing XML information is common to many projects. We showed int he previous post on how to parse XML documents using XmlSlurper. This post will focus on giving examples on how to parse documents using XmlParser.