Grails CAN HAZ REST 2!

Posted by: Andres Almiray on 2009-10-16 01:15:00.0
It surprises none that Grails can expose REST services gracefully and effortlessly, just watch how the masters do it in Mastering Grails: RESTful Grails. However making REST calls from within a Grails application is a task left to your own wits. Fortunately Groovy makes that task also a simple one, at least when it comes to GET, but what about POST or PUT? There are a few alternatives however:
  • Cook up your own REST library leveraging Apache HTTPClient, a common component used on the Java world.
  • Go one level up in the abstraction chain and use HTTBuilder, which relies on Apache HTTPClient.
  • Or simply type grails install-plugin rest.
That's right, the recently announced Griffon REST plugin has spawned a copy of itself as a Grails plugin. Provided behavior and configuration options are pretty much identical.

On a related note, a new version of the Grails J2D plugin has been released too. This release updates the plugin to GfxBuilder 0.2.1 (bye bye GraphicsBuilder!).

Feedback is always appreaciated.

Keep on Groovying!
be the first to rate this blog


About Andres Almiray

Andres is a Java/Groovy developer with mode than 10 years of experience in software design and development. He has been involved in web and desktop application developments since the early days of Java. He has also been teacher of computer science courses in the most prestigious education institute in Mexico. His current interests include Groovy, Scala and Swing. He is a true believer of open source and has participated in popular projects like Groovy, Griffon, JMatter and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member of the Griffon framework.

He likes to spend time with his beloved wife, Ixchel, when not hacking around.