There are use cases where we render the template from our action and update some div in the page using ajax. The downside of this approach is when the user hits the url directly in browser address bar and the … Continue reading
Category Archives: Design Pattern
Sometimes we want to show count bubble in Accordion head that is different from the what jQuery mobile provides by default. To add count bubble to Accordian head, we use following piece of code: But it doesn’t give us the … Continue reading
Redis plugin provides a beautiful way to cache the html tags. Using this plugin we can make big savings on the time taken to render the gsp tags.1
I found this tag extremely helpful in rendering the public facing pages of our site. the pages which refreshed not very frequently and required few seconds to render(if done without caching).
The difference in the time taken to render the page is dependent on our choice of right candidate for Memoizing.
Hope this helps!!!
Following DRY is practised religously in my current project. Recently, I identified a case where code repetition had long been ignored. We used to pass either a domain object or a command object in the view model. Due to this, … Continue reading
Whenever I have the use case of inheritance in my Grails application I prefer to have the single table for all the classes, to avoid joins and multiple save statement. But one thing I dont like about this is its class … Continue reading
In Grails we can have inheritance with abstract base class as well as persistent base class. Lets take an example to explain this.(All the classes are in the package com.intelligrape.example) By creating such class structure Grails will create a single … Continue reading
We can use PostConstruct with Grails Services and injected Spring Beans. This PostConstruct annotation can be used to annotate a method which needs to be executed after dependency injection to perform any initialization. Check this for more details. We also … Continue reading
Grails uses Sitemesh for adding layout to the views. Layouts are located in layouts folder and to add layouts to the view we generally add any of the following line in head But most of the time we have single … Continue reading
One feature that I really like in Grails 2.0 is action arguments databinding. While reading more about it I also found a nice grails.web.RequestParameter annotation. When you know something you always find its use case. In my recent project I … Continue reading
As I am a lazy programmer most of the time I dont implement toString and equals methods on my grails domain classes. I would like to say thanks to Groovy for helping me out and giving me a ready made … Continue reading