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.

3 Comments
  • Benjamin Wolff
    Posted at 12:17 pm, December 4, 2012

    Hi Ralf,

    thank you very much for the announcement on the blog, a nice and accurate summary ;). I would really love to see it getting some traction in both communities and I’m looking forward to add features and improve the integration of these two great technologies.

    Cheers,
    Ben

  • Benjamin Wolff
    Posted at 12:05 am, December 6, 2012

    Hi Ralf,

    that was indeed a mistake in the documentation, I fixed it. Thanks for pointing this out!

    I was planning to add the configuration for themes as a next step. I created an issue here to talk about the implementation: https://github.com/bwolff/grails-rwt/issues/2

    Don’t hesitate to add your comments or to create other issues with ideas for further improvements/enhancements.

    Cheers,
    Ben