1. Using JRuby on Rails With Sun GlassFish Enterprise Server
2. Developing Grails Applications
Introduction to Groovy and Grails
Creating a Simple Grails Application
To Create the helloworld Application
To deploy and run your application, perform the following task:
Change to the application directory. For example:
cd as-install/grails/samples/helloworld
Create the WAR file using the following command:
grails war
This command creates a WAR file, helloworld-0.1.war in the helloworld application directory. The WAR file contains all the application's dependencies, and various jar files.
Deploy the WAR file in one of the following ways:
In the Administration Console, open the Applications component, go to the Web Applications page, select the Deploy button, and type the path to the WAR file. For example:
as-install/grails/samples/helloworld/helloworld-0.1.war
Use the asadmin deploy command from command line to deploy the WAR file. For example:
asadmin deploy helloworld-0.1.war
Note - Depending on the configuration, you might be prompted for the asadmin password at this time.
To test your application, enter http://host:port/war-file-name in your browser. Do not include the .war extension. For example:
http://localhost:8080/helloworld-0.1
You should see a screen that shows the following message:
Welcome to Grails
Clicking the HelloController link should change the display to the following message:
Hello World!
For details about the Administration Console, see the online help.
For details about the asadmin deploy command, see the Sun GlassFish Enterprise Server v3 Reference Manual.
For details about the grails commands, see the Grails Quick Start.
For general information about deployment, see the Sun GlassFish Enterprise Server v3 Application Deployment Guide.