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
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