grails first app

Grails cooljun 2215℃ 0评论

1>    打开doc

 

  键入:e:进入对应的盘符
   进入工作文件:cd  java\work
   在文件里创建项目:grails create-app  test1
   给项目test创建domain :grails create-domain-class Student
2> 修改test1>grails-app>domain>test1>Student.groovy文件

代码:

package test2

class Student {

    static constraints = {
    }
    String name
    String major
    Integer age
}

3> 根据Student文件产生其他的界面文件
进入doc
键入grails generate-all test1.Student
(注意:test1项目名一定要写)
4> 运行app
grails run-app
成功后再浏览器输入http://localhost:8080/test2就可以看到一个简单的关于student的页面

转载请注明:cooljun小窝 » grails first app

如果你觉得这篇文章对你有帮助,请支持我继续更新网站 !捐赠本站
喜欢 (0)or分享 (0)

您必须 登录 才能发表评论!