Salil

Technology Think Tank

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,...

by Salil
15-Oct-2010

Grails

GRAILS specific LOCALE Handling – Change Language and return to the same page

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 ...

by Salil
14-Sep-2010

Grails

Tips for Agile Development with Unit Testing approach.

This is more towards the best practices and my experiences for developing an application at a faster rate. In my current project, we are using many different APIs (for external services). And usually it takes time to explore, implement and then stabilize the application. Also, it's not over once you stabilize your APIs based code....

by Salil
14-Jul-2010

Technology

jQuery Alert Message without using traditional javascript alert-box.

This post might help you if you want to display alert messages without using tradition javascript (irritating) alert. To achieve this you need jQuery for your frontend UI. Below is the javascript method (code snapshot) which displays your message for 5 seconds. And then fades out automatically. function displayAlertMessage(message)...

by Salil
14-Jun-2010

Grails

Create JSON object Using Grails converter (Only selective fields from lists of objects)

This post might help you if you want to get JSON (JavaScript Object Notation) Object on browser. Grails framework provides you very efficient way to achieve this. For this you need to import grails JSON convertor in your code. import grails.converters.JSON Below is the code snapshot which converts java based lists of Objects to...

by Salil
13-May-2010