Grails and Dojo – Adding Dojo components to a SpringSource Grails Project – The Dojo Adventure

Reason for this Adventure

Recently I had the opportunity to sit in on a quick intro of Spring Roo, held by one of the co-authors of Roo In Action (Gordon Dickens).  Besides seeing the interesting things the SpringSource Roo development tool has to offer, I found myself focusing on how professional and tight a SpringSource Roo web application looked.  After some research, I found out that SpringSource Roo uses the Dojo JavaScript Toolkit library to aid in some of the user interface components which made the application look so professional.  So, I set out to see how difficult it would be to get a SpringSource Grails web application to use the Dojo library, thus giving me the professional look and feel with a SpringSource Grails application.   I had one rule before starting:  NO USE OF GRAILS PLUGINS.  My personal guiding principal is that Grails Plugins are only to be used as a code starting point, and you should always source control your own version of the plugin if you choose to use one (but always invest time to contribute back to the original project!).  Using Grails Plugins without source controlling your own version is just asking for trouble.  So the following tutorial is what I discovered during my “Dojo Adventure” …

As this is not a post on installing and configuring SpringSource Grails, I will assume that you already have Grails up and running.  To work along with me, you will need to download a version of the Dojo JavaScript Toolkit Library.

My Settings:

  • Grails 1.3.3
  • Dojo 1.5.0
  • JDK 1.6.0_20

Okay – lets start the Adventure!

Watch the two videos to see how to integrate Dojo with Grails

Video 1 – Setup the grails web application with Dojo Install included

Video 2 – Use two Dojo UI widgets in our Grails Web Application

3 responses to this post.

  1. Posted by Franz on August 22, 2010 at 12:57 pm

    I can confirm your statement about Grails plugins. I tried to “upgrade” my application from an old Acegi version to the “new” Spring Security. This was very painful. At the end, I created a completely new Grails application, then got the newest version of the plugin and after that, I “integrated” my own Domains, Controllers and so on from the old application into the fresh one. This was the only way how I got it to work. The point is, that I know my own domains, controllers, etc. very well but the new classes of an “upgraded” plugin is always a search in the dark.

    Reply

  2. Posted by M.Faith on October 22, 2010 at 11:33 am

    THanks for the tutorial. THe first part is nice and detailed. In the second, it would be interesting to see more features.

    Reply

  3. Thank you, this helped a lot!

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.