Grails Cookbook - A collection of tutorials and examples

Grails collect Tag Examples

This will show examples on how to use the Grails collect tag(<g:collect>). This tag is similar to each tag and it iterates over each element of a collection. The difference is the added attribute expr.

Grails each Tag Examples

This will show examples on how to use the Grails each tag(<g:each>). This tag will iterate over each element of a collection.

Grails if Tag Example

The Grails if tag (<g:if>) renders it's body when the condition given is true. This will show a simple example on how to use this tag.

Grails unless Tag Example

The Grails unless tag (<g:unless>) renders it's body when the condition given is false. It is the opposite of the if tag that renders a body when the condition is true. This will show a simple example on how to use this tag.

Grails while Tag Example

The Grails while tag (<g:while>) can be used to render GSP section multiple times. It behaves similar to the while loop in Java/Groovy but just translated to a GSP tag. This will show a simple example on how to use this tag.

Grails textField Tag Example

The Grails textField tag (<g:textField>) can be used to render a input of type 'text' (a text field) form control. This will show a simple example on how to use this tag.

Grails textArea Tag Example

The Grails textArea tag (<g:textArea>) can be used to render a <textarea> form control. This will show a simple example on how to use this tag.

Grails currencySelect Tag Example

The Grails currencySelect tag (<g:currencySelect>) can be used to generate a dropdown list of currencies. This will show a simple example on how to use this.

Grails country Tag Example

The Grails country tag (<g:country>) can be used to render the default English name of a country given the ISO3166_3 3-letter code. This will show a simple example on how to use this.

Grails countrySelect Tag Example

The Grails countrySelect tag (<g:countrySelect>) can be used to generate a dropdown list of countries. This will show a simple example on how to use this.