本机下安装的grails程序,在本文档下可正常使用,若其它同类文档与此文档冲突,则以此文档为准.
重要说明: 在以下操作之前先要打开Apache 2.4服务程序.
不能使用.bat直接运行(因为不在同一线程),因为它会停止,只能在cmd命令提示符下输入一条条命令:
d:\Grails\grails-3.0.9> grails create-app helloworld
d:\Grails\grails-3.0.9> cd helloworld
d:\Grails\grails-3.0.9> grails create-controller hello
d:\Grails\grails-3.0.9> copy ..\HelloController.groovy grails-app\controllers\helloworld\ /Y
d:\Grails\grails-3.0.9> grails run-app
运行需要一点时间,当出现提示信息:
Grails application running at http://localhost:8080 in environment: development
此时当前cmd窗口不要关闭(因为它就是一个服务器正在后台运行)
现在就可以在浏览器中输入 http://127.0.0.1:8080 或 http://127.0.0.1:8080/hello
或者: 另打开一个cmd窗口输入:
d:\Grails\grails-3.0.9> start http://127.0.0.1:8080
d:\Grails\grails-3.0.9> start http://127.0.0.1:8080/hello
d:\Grails\grails-3.0.9> start http://127.0.0.1:8080/hello/world
HelloController.groovy可以修改成你要的程序文件,然后复制到指定位置.
重要说明: 在以下操作之前先要打开Apache 2.4服务程序.
不能使用.bat直接运行(因为不在同一线程),因为它会停止,只能在cmd命令提示符下输入一条条命令:
d:\Grails\grails-3.0.9> grails create-app helloworld
d:\Grails\grails-3.0.9> cd helloworld
d:\Grails\grails-3.0.9> grails create-controller hello
d:\Grails\grails-3.0.9> copy ..\HelloController.groovy grails-app\controllers\helloworld\ /Y
d:\Grails\grails-3.0.9> grails run-app
运行需要一点时间,当出现提示信息:
Grails application running at http://localhost:8080 in environment: development
此时当前cmd窗口不要关闭(因为它就是一个服务器正在后台运行)
现在就可以在浏览器中输入 http://127.0.0.1:8080 或 http://127.0.0.1:8080/hello
或者: 另打开一个cmd窗口输入:
d:\Grails\grails-3.0.9> start http://127.0.0.1:8080
d:\Grails\grails-3.0.9> start http://127.0.0.1:8080/hello
d:\Grails\grails-3.0.9> start http://127.0.0.1:8080/hello/world
HelloController.groovy可以修改成你要的程序文件,然后复制到指定位置.
674

被折叠的 条评论
为什么被折叠?



