Tomás Lin’s Programming Brain Dump

Flex, Grails, Facebook, iPhone and all that Jazz

Posts Tagged ‘REST

A simple ActionScript / Flex REST client

with 6 comments

When I started my new job a few months ago, we inherited a Cairngorm-based Flex REST client that was ugly, clunky and hard to maintain. Worst of all, due to Cairngorm’s brutal MVC model, it didn’t allow us to call the service in the context of the Flex component.

Our architect Tim re-wrote it into a single class, stripping out all the Cairngorm madness so it can be
called within a single service. More recently, I refactored the class into a singleton and removed some legacy Spring Security authentication — now handled by the Jsecurity plugin in Grails.

Combined with the Content Negotiation features of Grails, this allows us to quickly communicate with a flex application without the need to the complex binding provided by the BlazeDS platform from Adobe ( which, by the way, is available to Grails through the Flex Plugin ).
Read the rest of this entry »

Written by Tomas Lin

June 12, 2008 at 1:46 am

Posted in Uncategorized

Tagged with , ,

REST Service XML Output in Grails via Content Negotiation

with 5 comments

The content negotiation feature in Grails is pretty cool. In a nutshell, it allows you to return different formats based on the request of your page.

A recent project I worked on used Grail’s ability to generate CRUD as GSP pages to provide a basic CMS service, and an Adobe Flex front-end that communicated with Grails via REST services. We needed a solution that will preserve the original GSP html output, as well as the ability to return the data as XML for the REST layer.
Read the rest of this entry »

Written by Tomas Lin

May 15, 2008 at 4:01 pm