Access ServletContext In Grails gsp

ServletContext is used to store global application attributes among other things,e.g In grails controller we can store global application attribute as : def mySetting = servletContext["mySetting"] servletContext["mySetting"] = "foo" asset...

Locale and Message Bundle in Grails

I am back with a new blog post titled “Locale and Message Bundle in Grails”. In grails we define all the string content/description in message.properties file. In order to fetch the message in gsp page we can use the following code:- <g:set...

Loops in GSP

Loops are one of the most important and useful part of every programming language. Grails provides various loops in controller and view. Following are the loops in GSP: each: each tag is used to iterate over each element of a list. <g:each in="${books}"...

Grails Scaffolding Templates

In Grails we often use Grails Scaffolding Templates using defscaffold = true in our Controller which automatically creates CRUD operations. Scaffolding uses the templates for code generation which can be installed by this command:- grails install-templates The...