Creating “Hello World” Web Application Using the Grails Framework
Setting Up Development Environment For Grails on Windows Vista/XP and GNU/Linux.
Just to make sure, check out again if the following environment variables are set properly on your operating system.
On Windows:





PATH should be set to something like(you can also check with ‘echo %PATH%’ on the command prompt):
c:\ruby\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin;C:\Program Files (x86)\Subversion\bin;%JAVA_HOME%\bin;%GROOVY_HOME%\bin;%GRAILS_HOME%\bin
On GNU/Linux:
/usr/lib/jvm/java-6-sun :: /home/tabrez/groovy :: /home/tabrez/grails
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tabrez/groovy/bin:/home/tabrez/grails/bin
Open the command prompt and run the following commands:
[lot of text]
Created Grails Application at C:\Users\tabrez\grails_apps/hello
# cd hello && dir
.classpath
.project
application.properties
build.xml
grails-app
hello.launch
hello.tmproj
lib
scripts
src
test
web-app
[lot of text]
Created ControllerTests for Hello
Run the web application and view it in the web browser.
[lot of text]
Server running. Browse to http://localhost:8080/hello
2008-06-15 15:55:51.363:/hello:INFO: GSP servlet initialized
Now our application is running at the specified url. To invoke the controller that we had written earlier(Step 3), open the following url in a web browser:
http://localhost:8080/hello/hello/hello
And you should see the following output.

(If you are confused about the url: the first hello is the name of the application, the second hello is the name of the controller and the third hello is the name of the action to be invoked. In non-hello-world applications, these three will be different from each other!)
That’s it. You have created and executed your first Grails web application. Next up is IDE integration.
Resources:
For more information, refer to the following resources:
1. Grails QuickStart Guide
2. Grails Tutorials and Screencasts
3. The Definitive Guide to Grails (Amazon)