Told you, we love sharing!
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. ...
Hey guys, I found something very useful, so sharing it here. In one of my project there was a requirement to create a fixed length user-id. Let's say it was 5 characters ID. So in other words we required to convert - '123' to '00123' and '1000' to '01000' and '12345' will remain '12345'. It appears very simple, but the thing is how...
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 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,...
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 ...
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....
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)...
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...