In one of the sessions in SpringOne2GX, there was a session on Uber-Scaffolding by Jean Barmarsh. The session was quite incredible and opened up a world of possibilities. We all know that the scaffolded code generated by grails is modifiable if we install the base templates. This is done simply by saying: [java]grails...
We have been coming across a certain use case in a couple of projects that the Email credentials/settings used for sending email should be different based on the from address. This is because the applications act as software services that are used by different organizations, which operate in the same business. And each needed their own...
Hello friends, In my grails project, I was finding it difficult to write a query using criteria which can be read as 'list all customers whose current account balance is more than minimum account balance of that customer'. The simplified form of the domain is given below : [java] class Customer { String name Account account ...
Last week, I was talking to a prospective client, who instead of asking me, why we should go with TO THE NEW, asked me, why should we go with Grails? Considering the fact that I have been working with Grails for over 3 years and we are a Groovy/Grails focussed shop, it should have been an easy question to answer; but there were so many...
Grails Development is challenging and most Groovy and Grails projects require in-depth understanding of thread-pooling. As a Groovy developer, I really like the thread-pooling API (in java.util.concurrent package), especially when you are hitting x number of API dealing with outside network to fetch information for a single request. ...
While using Geb for fuctional testing i require some deugging support so i use PageChangeListener and i found it very useful to find flow of pages while testing my application fuctionally.What it does is it will show the page flow from one page to another.For that we need to just register the PageChangeListener with browser in your ...
We have a setup where a backend thread, fired by the Spring Events, does some processing, generates a PDF and emails the result to the user. The code we were using to generate the HTML from a GSP to be converted to a PDF using iText was as follows : [java] def webRequest = RequestContextHolder.getRequestAttributes() ...
I had to make a video available on my GSP page. So I looked at the grails flash-player plugin. After going through the documentation I found that it could not be used with videos on YouTube. This code given below will generate the script for the flash player on your GSP for playing youtube videos. [html] <object...
Grails applications can define their own codecs and Grails will load them along with the standard codecs. A custom codec class must be defined in the grails-app/utils/ directory and the class name must end with 'Codec'. For more information see Dynamic Encoding Methods. [java] import java.security.MessageDigest import...
Recently I was working on webhooks (which are getting quite popular for sending notifications to other applications using HTTP POST methods). MD5 encoded content is heavily used in webhooks for security concern. My purpose of writing this blog is neither to explain MD5 nor webhooks. But just to show you - 1. a quicker way in...
I had earlier written a post on how to use QR Code to take care of identification of printed documents and updating the DB based on the QR Code detection. However, we had to abandon the use of QR Codes in the document because the library wasn't performing reliable, even with QR Codes from image files, which were direct screenshots of the...
Peter Ledbrook took an amazing session on tuning your grails Application here at SpringOne2GX in Chicago. In this session Peter talked about tuning the various aspects about in your application starting from server side optimizations to the caching and zipping of static resources. One of the most important thing that Peter pointed out...