Posts

Showing posts from 2010

Creating our First Grails Application (e.g. racetrack)

Image
command prompt> grails create-app racetrack command prompt> cd racetrack command prompt\racetrack> grails run-app Open your browser to http://localhost:8080/racetrack/   Directory Structure   From this information, we can see that we’re basically working with two types of data –races and registrations – and that there’s a one-to-many relationship between those entities. That information will form the basis of our domain model, and the various data elements on the form will become the attributes of our domain classes.  Create-Domain-Class racetrack> grails create-domain-class Race class Race { String name Date startDateTime String city String state Float distance Float cost Integer maxRunners = 100000 static hasMany = [registrations:Registration] } racetrack> grails create-domain-class Registration class Registration { Race race String name Date dateOfBirth String gender = 'F' String emailAddress String postalAddress Date crea

Grails Basic

Image
Web Framework inspired by RoR(Ruby On Rails) Latest version is 1.1.1. Based on open source technologies like Spring, Hibernate and SiteMesh Grails = Spring MVC 2.5.1 + Hibernate 3 + SiteMesh2.3 Newbie's are unaware that Grails is full and full Spring! Provides several commands to auto generate common requirements in a web app. Comes bundled with HSQLDB and Jetty web Server Focus is on rapid development and simplicity Coding by convention paradigm Reduce the need for configuration files and other boilerplate code File names are important Features Rapid web application development Follow spring MVC framework -Clearly separates business, navigation and presentation logic Proven mechanism for building a thin, clean web-tier Both gsp and jsp are supported.  AJAX Support Supports prototype, YUI, DOJO Use render method in your groovy code to render text, HTML, JSON Has lots of plug-in already available like quartz, acegi , RichUi etc… grails create-plugin !