It was bound to happen. The Groovy folk have seen the boon from Ruby on Rails, and want to get in on some of that action :)
A discussion of Grails (Groovy on Rails) sparked up on the mailing list, and miracles happen… code has come out of it.
Steven Devijver put together the first 0.0001 release of this code:
A first version of Grails is available in CVS. It’s located under groovy/modules/grails. Currently simple controllers are implemented together with JSP support. The MVC part is based on Spring MVC.
Build the project via “ant jar”
To start your own project with Grails set the GRAILS_HOME environment variable. Next create a directory for your project and from within this directory run this command:
ant -f ${GRAILS_HOME}/src/grails/build.xml -Dbasedir=`pwd` init
to initialize the project directory structure.
Place your controllers under the grails-app directory and your JSP’s under the jsp directory. A simple controller in Grails looks like
this:class NamesController {
@Property String namesView = “names”
@Property Closure names = {
request, response ->return [ "names" : [ "John", "Jill", "Jack", "Jaqueline" ] ]
}
}Then make sure to create a view.
To create a WAR for deployment run this command:
ant -f ${GRAILS_HOME}/src/grails/build.xml -Dbasedir=`pwd` war
This will create a war names grails-app.war.
When the WAR is deployed access it through this URI:
/grails-app/app/names
Obviously, this is insanely early days. It is so interesting to see how people are revisiting their way of dealing with web applications after Rails.
July 5th, 2005 at 8:29 am
It looks more like “groovy on Spring”, than “groovy on rails”:(
It did’t get the essential of rails.