Grails 2.2 and Groovy / Grails Tool Suite



Update: The new release of GGTS 3.2.0 fixes these issues and comes with the Groovy 2.0 compiler installed and configured as the default. You no longer need any updates or patches for GGTS to work with Grails 2.2.x.

Well, Grails 2.1.3 was released this week with 2.2.0 showing up the next day. If you use the Groovy / Grails Tool Suite for development, you will find that running certain Grails commands like run-app no longer work from within GGTS (they still work fine from the command line).

Until the next update to GGTS is released you can apply this update supplied by the nice folks at SpringSource:

  1. From the GGTS Help menu, choose Install New Software.
  2. Paste the following URL into the Work With field - http://dist.springsource.com/snapshot/TOOLS/grails-ide/nightly
  3. In the components list that appears, open the Core /Grails IDE for Eclipse item and check Grails IDE.
    GGTSUpdate
  4. Click Next, and continue with the defaults until the update is installed.

Now you are ready to try all the cool new stuff in Grails.

Basic Security


In this Grails Example, we complete the ProjectTracker application by implementing basic security. Although this is not a comprehensive discussion on web application security, you learn how to create a login page that authenticates your users against the EndUser model, as well as how to add an interceptor method to your controllers that authorizes your end users before executing any additional methods in the controller. For a complete discussion on security, please see the information on the Spring Security Core Plugin.

Additional credit for content on this video comes from Scott Davis’ article: Mastering Grails: Authentication and Authorization.

Constraints and Static Scaffolding


In this Grails Example, we add validation constraints to our model. This limits the data that an end-user can enter into our scaffolded views. Constraints in your model definition are automatically rendered in your scaffolded views. There are many types of constraints such as making a field required, unique, or one that only accepts a range of values.

Once we have our constraints in place, we will generate Static Scaffolding, which allows us to see the actual code behind the controllers and views that scaffolding uses. Using Static Scaffolding allows you to customize these files.

Video #15 shows how to enable data entry constraints and Static Scaffolding.