page banner
avatar
'Thread synchronization in Grails application using Hazelcast' post illustration
Thread synchronization in Grails application using Hazelcast

Recently, I have been looking for a way to implement thread synchronization in a Grails application which is hosted on several nodes on Rackspace. And while it's rather easy to synchronize threads within a single servlet container, it might be difficult to do it when the same data is simultaneously updated from separate server nodes. This post shows how this task can be solved with Hazelcast.

avatar
'Advanced GORM features: inheritance, embedded data, maps and lists storing' post illustration
Advanced GORM features: inheritance, embedded data, maps and lists storing

In my previous GORM related article, "Association Types in GORM", I have described how to create different types of relationships using Grails ORM. In this article, I would like to talk about several advanced GORM features that may help you in the development process, such as:

  • domain classes inheritance
  • embedded data
  • maps and lists storing

avatar
'Dynamically add and remove HTML blocks with Grails tag library and JQuery' post illustration
Dynamically add and remove HTML blocks with Grails tag library and JQuery

This post shows how to create Grails tag library for adding and removing identical HTML blocks, which can be used when you want to give user an option to dynamically add extra inputs for additional information. There are lots of simple JQuery and pure JavaScript solutions for this feature, but, in general, they are not flexible and clean enough for a Grails application. Pure tag library approach helps to avoid HTML and JS clutter in a GSP file and speeds up the development, since the only thing you need is to specify the tag with necessary parameters.

'Pagination and sorting in many-to-many relationship' post illustration
Pagination and sorting in many-to-many relationship

This example shows how to use pagination and sorting with many-to-many relationship in Grails.

avatar
'Association types in GORM' post illustration
Association types in GORM

GORM (Grails Object Relational Mapping) is a plugin integrated with Grails and based on Java ORM - Hibernate. In this article, I'm going to describe how to make different kinds of associations in GORM.

avatar
'How to deploy Grails (Tomcat 7) application to Cloud Foundry' post illustration
How to deploy Grails (Tomcat 7) application to Cloud Foundry

I had an issue with deploying my Grails project to Cloud Foundry with using cloudfoundry-grails-plugin. My application was using Tomcat 7 unlike Cloud Foundry, which use Tomcat 6. In other words, to have a Grails application with Tomcat 7 run, I had to deploy the entire Tomcat 7 directory, but before it should be slightly reconfigured.

avatar
'Get total records count with GORM criteria' post illustration
Get total records count with GORM criteria

Assume you have a page with pagination that displays some objects table (selected from DB with GORM criteria) in your Grails application. If you want to know total number of possible results (as if there are no pagination parameters), you can do it in this way:

avatar
'Customizing the field widget of the Platform UI Grails plugin' post illustration
Customizing the field widget of the Platform UI Grails plugin

Our team is working on a Grails plugin now, which will have UI based on Platform UI Grails plugin. Platform UI plugin allows you to easily configure Grails applications look using different page markups(themes). It provides a bunch of useful UI sets and allows the developers customize application look easily by creating own UI sets and themes.

avatar
'Changing the Grails project configuration from within a plugin' post illustration
Changing the Grails project configuration from within a plugin

This code snippet shows how to update project configuration settings from a Grails plugin executable script. The script changes the configuration by copying the settings from a default config file, placed in the plugin's folder, to the Config.groovy. This is usually very useful during a plugin installation when you need to provide some default configuration: