A few days back I had chance to work on a googleApp using GORM-JPA plugin,version (0.7.1). I came across a few problems which are as given below. Consider the domain : Country -> has many States. At first it appeared that the one to many relationships are to be managed using annotations like : Country […]
It’s common requirement when we work on some portal – we need to provide support for various languages. messages.properties/ResourceBundle is out of the scope of this post. Here I am just mentioning – how to switch to a different language taking an advantage of GRAILS On your view (gsp) page add following – English French […]
Hi Friends, Recently in one of the project I was working on, had a long web page and updates used to happen only through ajax calls that means no page refresh. The status messages used to appear on the top of the page, the user had no way but to scroll up to see the […]
Hi Guys, In one of my projects, While working with jasper reports, one of the requirement I faced was of passing optional parameter to the sql query in jasper report. For eg. I had to write a query to find all new customers which were added between two given dates and if an optional status […]
While implementing Security in my Sample Application I have read various types of Injection attacks that an application may suffer. Reference: Grails In Action 1. SQL Injection Attack: def username=”gautam” Post.findAll(” from Post as post WHERE post.user.username=’${username}’ “) This Query uses a local username property to control which posts are returned. Try this Query in […]
In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is “mod_expires.c”. This module is not enabled by default. You need to enable […]
Our project went into production a few weeks back and was on Grails 1.3.1. Since the code was stable, we decided that it was time to upgrade to grails 1.3.4. However, we didn’t want to push it straight to the QA Server or Production server because that would’ve meant that the maintenance of the existing […]
Grails docs are the best source to understand how to make best use of GORM methods and now the GORM Gotcha’s series By Peter Ledbrook is also making the docs easy to understand. So many time it happens when the domain instance values gets updated without calling save method.It happens because the object is attached […]
Recently I got a query regarding mapping a database table which do not have any id and version. For example the table have two varchar fields username and password nothing more than that. Although it was something strange for me that table doesn’t have the id field. The good thing is that the username is […]
The HTML <canvas> tag is used for creating graphics on the fly. It can be used for rendering graphs, game graphics, or other visual images. To draw on the canvas, the <canvas> tag is used in conjunction with the getContext(contextId) method. Any content between the <canvas></canvas> tags is “fallback content”- meaning, it will […]
We have been using GitHub for version control in one of our projects and I am absolutely loving it! There are quite many advantages over a concurrent version control system like subversion. One of the commands I found useful was the stash command. It is of use when we are working on a piece of […]
In my recent Nodejs project, we were required to generate the pdf document from HTML page. We are using iText renderer for doing this. The client had the requirement that each page bottom right needed to have a number on it. All these things need to be replicated on every page. So for doing this we […]