Sunday, March 9, 2008

Getting start with Grails for our Sparrow app

Today we'll start to our Sparrow app.As a learning project we'll begin from how to create and run an application.
As you can see,our app's name is Sparrow,then how to create it,follow me.
open your command line.type
>>make dir learnapp
>>cd learnapp
>>grails create-app
after this,grails will ask your what's name your project.we'll tyep
>>sparrow
then grails will generate all of you need to start an application.Note,Grails is a role framework.so you will see somes like domain,controllors,tlb folder etc.in the future,we'll create relative file to fit our application.for now,we only need a blamk frame,but it's a runable application.we'll start our first grails app.type following command:
>>cd sparrow
>>grails run-app
You will see some run time information in console.then open your favorite browser then type:
http://127.0.0.1:8080/sparrow/
you will see a welcom page like this:

Grails used Jetty as its default servlet container.In the future,may be you want to move it to other containers such as tomcat .or some appservers such as JBoss.You can just type grails war .Grails will generate a war file for you,then you can make your own deployment in others environment.
Now.through only a few commmand you create a runable application.It's really cool.In the following section,we'll discuss how to add our first domain model project.we'll add some useful feature for our application and introduce what grails's domain model is as same time.

No comments: