Sun GlassFish Enterprise Server v3 Prelude Developer's Guide

Creating a Simple Grails Application

To create the helloworld application, perform both these tasks:

For more information on creating Grails applications, see the Grails Quick Start.

ProcedureCreating the helloworld Application

  1. Go to the as-install/grails/samples directory.

  2. Run the grails create-app helloworld command.

    The grails create-app command creates an application framework that you can modify.

ProcedureCreating the hello Controller

  1. Go 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.

  3. Edit the generated HelloController.groovy file so it looks like this:

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