Grails是一個類似於Rails的Web架構,構建在Spring,Hibernate等架構的基礎上,可以與Java平台無縫整合。相對RoR來說,Java開發人員更容易上手。
Grails提供了完整的Web Application開發平台,內建了Jetty Server,並提供了強大的功能, 如簡單的對象關係映射(ORM),自動重新載入應用程式,為CRUD(新增,查詢,修改,刪除)操作提供代碼自動生 成支架(scaffolding)。此外Grails還提供了一些在Java中慣用的文法包括:運用AOP思想的攔截器,動態標籤庫,JSP和GSP (Groovy Servers Pages)支援。
Grails是Groovy on Rails的縮寫,也就是Ruby on Rails(ROR)在java的一種實現,另外一種實現是JRuby on Rails(JROR)。
我現在用的系統是ubuntu7.10 + jdk 1.5 + mysql 5
在ubuntu下配置grails環境可以用以下指令碼:
grails.sh#download grails
wget http://dist.codehaus.org/grails/grails-bin-1.0.zip
#unzip
unzip grails-bin-1.0.zip
#move to /opt/grails
mv grails-bin-1.0 /opt/grails
#let shells has permission to execute
chmod 774 /opt/grails/bin/*
chmod 744 /opt/grails/ant/bin/*
#set environment variable
echo 'export GRAILS_HOME=/opt/grails' >> /etc/bash.bashrc
echo 'export PATH=$PATH:$GRAILS_HOME/bin' >> /etc/bash.bashrc
source /etc/bash.bashrc
#test
grails