grails环境搭建
1. 安装
下载grails
下载页面
http://www.grails.org/Download
文件grails-bin-1.0.3.zip
解开压缩得到grails-1.0.3文件夹
环境变量:
GRAILS_HOME = D:/tool/grails-1.0.3
path中加入D:/tool/grails-1.0.3/bin;
然后安装groovy插件,点击Open Plugin Manager
在Available里面搜索 jetgroovy ,右键 download and install
2.新增项目
create project from scratch
选择grails Application
选择安装grails的路径 D:/tool/grails-1.0.3/bin;
选中项目
new----->grails------>grails controller
输入hello,选择grails-app/controllers目录,会在目录中生成HelloController.groovy文件
在文件中输入
def index = {
render "hello,sillycat!"
}
在IDE的工具栏的Window---->Tool Windows----->Grails,打开运行的log窗口
Edit Configration里面增加一个easygrails,在Grails Script Parameters里面输入 run-app
直接启动,访问
http://IP:8080/工程名 -- 就可以访问到刚才的hellocontroller,看到hello,sillycat的页面了。