Home » Tag Archives: Grails (page 3)

Tag Archives: Grails

Grails Tutorial for Beginners – Criteria API

grails-logo

This tutorial will show how to use Criteria API to search data from the database. Criteria is a powerful API and an elegant alternative to HQL. Introduction This previous post showed that HQL is a powerful way to perform complex queries. However, it is not very elegant if an HQL statement is not fixed and needs to be concatenated. For ...

Read More »

Grails render images on the fly in GSP

grails-logo

This tutorial will show how to generate PNG images on the fly and display inside a GSP. This can serve as a basis on how to create a more complex behavior. For example, creating report graphs for display in your applications. Sample Output This tutorial will show how to generate simple shapes based on input size and color. Squares and ...

Read More »

Grails Tutorial for Beginners – Grails Service Layer

grails-logo

This tutorial will discuss the importance of the service layer in Grails and how to work with it. It also explains transaction management and how to utilize it. Introduction Separation Of Concerns Consider this analogy: Imagine a company where employees are assigned tasks on different nature of work. For example, say there is an employee named John Doe with the ...

Read More »

Grails domain classes and special presentation requirements

grails-logo

In Grails we often use our domain objects directly as backing model for presentation purposes and only for specialized situations we create value holder objects or DTOs. Beginning Grails developers know how to display individual entity properties pretty easy in a GSP, such as the name of a fictional domain class…             <g:each in=”${breedingGoals}” var=”breedingGoal”> ...

Read More »

Grails Tutorial for Beginners – Grails Service Layer

grails-logo

This tutorial will discuss the importance of the service layer in Grails and how to work with it. It also explains transaction management and how to utilize it. Introduction Separation Of Concerns Consider this analogy: Imagine a company where employees are assigned tasks on different nature of work. For example, say there is an employee named John Doe with the ...

Read More »

Grails Spring Security Core Plugin – Registering Callback Closures

grails-logo

I was searching for a way to hook business logic after successful user login while using Spring Security Core plugin. The simplest way to do this is to register callback closures. It let’s you hook your custom code inside Config.groovy after certain Spring Security events. If you are unfamiliar with this plugin, visit the previous tutorial on Spring Security Core ...

Read More »

Grails Generate Asynchronous Controller

grails-logo

Since version 2.3, Grails supports asynchronous parallel programming to support modern multiple core hardware. Therefore a new Grails command is added to generate asynchronous controllers for domain classes. The generated controller contains CRUD actions for a given domain class. In the example below, we will generate a default asynchronous implementation of a Grails controller. First we create a domain object: ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials