Exit Print View

Sun GlassFish Enterprise Server v3 Scripting Framework Guide

  This Document Entire Library
Print View

Document Information

Preface

1.  Using JRuby on Rails With Sun GlassFish Enterprise Server

2.  Developing Grails Applications

Introduction to Groovy and Grails

Installing Grails

To Install the Grails Module

Creating a Simple Grails Application

To Create the helloworld Application

To Create the hello Controller

Deploying and Running a Grails Application

To Run a Grails Application Using Standard Deployment

3.  Jython on Django

4.  Scala and Lift

5.  PHP

Creating a Simple Grails Application

To create and run a simple helloworld application, perform the following tasks:

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

To Create the helloworld Application

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

  2. Run the grails create-app helloworld command.

    The grails create-app command creates a helloworld application that you can modify.

To 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 = { }
    }