Oracle GlassFish Server 3.0.1 Scripting Framework Guide

ProcedureTo Create the hello Controller

  1. Change to the as-install/grails/samples/helloworld directory.

  2. Run the grails create-controller hello command.

    The grails create-controller command creates a controller file that you can modify in the /grails/samples/helloworld/grails-app/controllers directory:

  3. Edit the generated HelloController.groovy file so that it looks as follows:

    class HelloController {
           def world = {
                    render "Hello World!"
        //def index = { }