RAP on Grails

Last week Benjamin Wolff, a long-known RAP fellow, announced that he has just created an RWT plug-in for Grails.

Grails is a ready-to-use web framework with some great featues such as a persistence layer with ORM, dependency injection, unit testing, and advanced web APIs. It comes with a command line that helps you create and run web applications and can also export them as .war files. Grails is based on Groovy, and since Groovy runs on the JVM, it allows to leverage existing Java libraries–such as the RAP Widget Toolkit.

Benjamin says that he was “always missing the nice API and widgets that RAP provides” when working with Grails. So he tried to integrate RWT into a Grails application. With the new decoupled design introduced in RAP 1.5, this was an easy task for someone who knows both RAP and Grails.

After this worked out well, he decided to make his integration available for others as a Grails plug-in. Now you can start writing RWT applications in Grails right away by simply including a plug-in. An RWT application is set up the Grails way, using a configuration:

rwt {
  entrypoints {
    // Configuration of an entry point named 'hello', the relative URL path will be '/hello'
    hello {
      bean = 'helloEntryPointService' // The name of the entry point bean (required)
      pageTitle = 'Hello RWT!' // The browser title that will be displayed (optional)


You can find a simple example RWT application using some Grails features on the GitHub page of the RWT plug-in. As you see, the plug-in not only provides plain RWT, but also JFace, making it easy to bind complex data to your UI. And Grails’ O/R mapping and dependency injection make it even simpler.

This is just the first release of the plug-in. Benjamin is planning some improvements and is interested in any feedback. At the moment, the plug-in incorporates RWT in the latest version 2.0M3. But when RAP 2.0 is released in February 2013, there will be a update of this plug-in available that includes the RAP artifacts directly from Maven.

We are always happy to see RAP being used in new contexts, and in particular it’s great to see that our decoupling in RAP 1.5 proves helpful for others.