It’s 2am, but I’m on a roll (though my typing is suffering somewhat and focussing has started to become an effort) and I’ve just discovered how to get the action and controller names in a Grails GSP. Continue reading
Tag Archives: Grails
How to Login a User with the Grails Acegi/Spring Security Plugin
The Grails Spring Security plugin is a wonderful thing and certainly worthy of more time spent on it than in this quick post. It saves days, if not weeks of work, plumbing in the standard security model of most websites. Notwithstanding its obvious benefits, I have noticed that many people struggle with some features of it, especially when retro-fitting it to an existing database schema and I can only assume it’s because the best examples of performing common tasks are only seen when generating the classes from scratch, using the generate-registration and generate-manager scripts.
Grails Filter Fail (Update)
[sigh] Some days just seem to be wasted trying to work out why some apparently simple task cannot be accomplished. The frequency of such days has increased somewhat since I started using Grails – while I am a fan of the framework it is still occasionally buggy and badly documented and I seem to stumble into issues every week.
Rendering JSON in Grails: Part 3 Customise your JSON with Object Marshallers
So far I’ve shown how to produce JSON from simple collections and how to convert domain objects to JSON, in this final post in my three-part look at rendering JSON from Grails controllers, we’ll take a look at customising the way objects are rendered by the JSON converter. Continue reading
Why Won’t My Data Bind!
I love having the ability to create property getter and setter methods in Groovy and it really simplifies all those bean accessors in Grails domain classes. At least, it does until you define one incorrectly and spend an embarrassingly long time trying to work out why data in your Grails controller isn’t being bound… Continue reading
Potential Problem with the Grails RichUI Plugin AutoComplete Tag
I’ve been using the Grails RichUI plugin and have found a few of the tags it provides to be very useful. The one I’m using the most is the AutoComplete tag which I may well be writing more about in the near future. However, tonight I found a potential issue with the way it creates the YUI data source for the component – it seems it always gives it the same name: ‘autoCompleteDataSource’.
Rendering JSON in Grails. Part 2: Plain Old Groovy Objects and Domain Objects
In my last post I went through the very basics of rendering JSON in Grails. In this post I’ll cover the rendering of POGOs and Grails domain objects. Continue reading
Rendering JSON In Grails. Part 1: Collections, Testing and the JSONBuilder
One of the many useful features Grails provides is the ability to quickly render data as JSON so it’s possible to interface with the many AJAX libraries available with a minimum of coding fuss, or provide an API to 3rd parties with very little effort. Having implemented such behaviour I’ve found that a little more than the basic understanding is helpful for success in real applications, so over the next 3 posts I will attempt to convey the simplicity and power of this feature while also giving some practical tips. Continue reading