`
wangcheng
  • 浏览: 1453076 次
  • 性别: Icon_minigender_1
  • 来自: 青岛人在北京
社区版块
存档分类
最新评论

使用IntelliJ IDEA开发Grails应用

阅读更多

如果还没有安装IDEA或者JetGroovy插件,请看我上一篇《安装IntelliJ IDEA JetGroovy》

http://wangcheng.iteye.com/blog/156885

 

1.下载Grails
http://grails.org/Download
下载grails-bin-1.0.1.zip后,解压到硬盘。
你也可以安照其它文档的介绍,配置环境变量等。

 

2.配置JetGroovy插件
File -> Settings -> IDE Settings -> Groovy&Grails
在Groovy的Groovy installation directory中设置Groovy的解压缩目录.
在Grails的Grails installation directory中设置Grails的解压缩目录.

 

3.创建一个Grails项目
File -> New Project -> Create project from scratch
在Select type中选Grails Application
在Name中输入一个项目名,比如myGrailsProject
然后一路next,IDEA就会为你创建好Grails项目结构

 

4.创建Controller
New -> Grails -> Grails Controller
输入一个Controller的名字,比如 hello
然后就会打开一个HelloController.groovy的文件
输入内容如下

//groovy code
class HelloController {

   def index = {
        render "Hello World! my first Grails";
    }
}

 

5.配置Run Configurations
Run -> Edit Configurations
点右上角的 "+" (Add New Configurations)
选择Grails Application
在Name中输入一个名字
也可以在VM Parameters中写参数,比如修改port等


6.启动

直接Run就运行了。
启动后会提示
Server running. Browse to http://localhost:8090/myGrailsProject
访问http://localhost:8090/myGrailsProject 然后点击HelloController 就可以看到输出了。

 

 

参考

http://grails.org/IDEA+Integration

 

  • 描述: config
  • 大小: 30.8 KB
分享到:
评论
4 楼 yidao620c 2012-05-02  
  
3 楼 点睛龙 2008-11-20  
现在可以考虑使用NB6.5了
2 楼 tongyi121 2008-05-29  
grails还真的应该用IntelliJ,支持的最好。
1 楼 webgame 2008-03-24  
IntelliJ  毕竟使用人数太少

NB6.1 还没有用过

相关推荐

Global site tag (gtag.js) - Google Analytics