TO THE NEW Blog PAGES

Grails

Encode Content to MD5 Using GROOVY or GRAILS – with Webhook example

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 […]

Salil
Salil
Read

Grails

Datamatrix for unique identification of Documents on Server Side with libdmtx

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 […]

Vivek Krishna
Vivek Krishna
Read

Grails

SpringOne2GX : Peter Ledbrook’s session on Performance Tuning

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 was to […]

Himanshu Seth
Himanshu Seth
Read

Grails

Execute Groovy script in Grails

Working with groovy is really a cake walk. Whenever I get some free time I try to know more about it. Today I was just wondering on the net and I found some cool tips to execute groovy file in grails. There are so many other ways available to run groovy script in grails, I […]

Grails

Externalize and reload grails configuration dynamically

Reloading configuration from external Configuration files without restarting the web container and putting the configuration file external to war file. I Used config.merge and new ConfigSlurper().parse( ) to merge the external configuration into the running application’s configuration

Bhagwat Kumar
Bhagwat Kumar
Read

Grails

GORM feature: Bypass Grails Domain Constraints

I didn’t know this earlier, but found a very good feature of GORM – ‘bypass’ constraints or ‘customize’ validation while saving a domain-object. I am not sure if there’s any name for this feature. But I am naming it as ‘bypass constraints’. [groovy] if(domainObject.validate([‘field1’, ‘field2’])){ domainObject.save(validate:false, flush:true) } [/groovy] Let’s discuss it with a use […]

Salil
Salil
Read

Grails

Regex to match exact word in a string

Hi, In my recent grails project, i needed to check the occurrence of a word in a string. I could have used contains() method of groovy , but the problem with contains() is that it also matches the word if the word is contained as a substring in any word. I searched a lot, but […]

Vishal Sahu
Vishal Sahu
Read

Grails

Get absolute URL of site Grails application is available at?

Many times, we need to get the absolute URL of the site/application. One such case is when we are sending out links to the application in emails. The default Config.groovy file provided by Grails has a property with the name grails.serverURL. I have typically used it to get absolute URL (environment specific)  of the site […]

Deepak Mittal
Deepak Mittal
Read

Grails

Regex in grails CreateCriteria

Sometimes we need to retrieve the result on the basis of some regular expression pattern which could be applied to a column. In such situations its better to use a rlike method provided by Grails CreateCriteria. Using rlike method it’s easy to retrieve Result based upon the Required Pattern. rlike Method is Similar to like, […]

Grails

Rich Domain Model in Grails

I have been working on grails for quite some time now. As a beginner, I had doubts about where to place the business logic in grails. Seeing the CRUD, one can easily be misled into putting most of the code in the actions, but as the code base goes bigger, it becomes difficult to manage […]

Imran Mir
Imran Mir
Read

Grails

Working with Excel Import Plugin

In a use case, I needed to import excel spreadsheet and save the data in the database, that was when I came across grails’ excel import plugin. All I had to do was install the plugin and start using it. No Fuss. I created a class in my src/groovy folder [groovy] import org.grails.plugins.excelimport.* class StudentImportXLS […]

Sachin
Sachin
Read

Grails

Video Tag in HTML 5

Video define new element in html 5. video play without third party plugins as Apple Quict Time and Adobe Flash player.The video element is dectect to be usable without any detection script. You can specify multi video file and browser that support html 5 video use choose the base on what video format they support. […]

Umar
Umar
Read