Listing 10. Passing tests in grails.
清单10.在Grails中通过测试。
Accessing a database pool from grails.
从Grails访问数据库池。
Then, enter grails generate-controller.
然后,输入grailsgenerate-controller。
输入grailsstats。
Type grails run-app to start the application.
输入grailsrun-app启动应用程序。
Take a look at grails-app/views/flight/create.gsp.
查看一下grails-app/views/flight/create.gsp。
Type grails stats at the command line to confirm this.
在命令行输入grailsstats以确认这点。
USER_HOME/.grails/scripts - user-specific event handlers
USER_HOME/.grails/scripts——用户特定的事件处理器
To begin, type grails create-tag-lib Login at the command prompt.
首先,在命令提示下输入grailscreate-tag-libLogin。
To begin, open grails-app/controllers/EntryController.groovy in a text editor.
首先,在一个文本编辑器内打开grails-app/controllers/EntryController.groovy。
When you type grails clean, the application directory under projects is deleted.
当键入grailsclean时,projects下的application目录会被删除。
To prepare a full grails application for deployment, you normally type grails war.
要准备一个完整的grails应用程序以便部署,通常需要输入grails war。
To see both the init and destroy events fire, start up grails in interactive mode by typing grails interactive.
要查看init和destroy事件触发,输入grailsinteractive以交互模式启动grails。
The script compiles code from the grails-app tree and combines it with code from the base Grails ($GRAILS_HOME) directory.
该脚本编译grails-app树中的代码并且将其与基本Grails ($GRAILS_HOME)目录中的代码组合在一起。
If all goes well, you'll have two new files waiting for you: grails-app/domain/Trip.groovy and grails-app/test/integration/TripTests.groovy.
如果一切顺利,将得到两个新的文件:grails-app/domain/Trip.groovy和 grails-app/test/integration/TripTests.groovy。
Type grails generate-all Trip to build out a grails-app/controllers/TripController.groovy class and a matching set of Groovy Server Pages (GSPs) in grails-app/views/Trip.
输入grailsgenerate-all Trip,以构建一个grails-app/controllers/TripController.groovy类,并在 grails-app/views/Trip 中生成一组匹配的GroovyServerPage(GSP)。
Running a Grails web application.
运行一个Grailsweb应用程序。
I'll also talk about Grails services.
我还会讨论Grails服务。
Writing your first Grails application.
编写第一个Grails应用程序。
Rendering JSON in a Grails controller.
在Grails控制器中呈现json。
Restart Grails if it is still running.
如果Grails仍在运行的话,重新启动它。
Listing 7. A simple custom Grails tag.
清单7.简单的自定义grails标记。
Restart Grails with these new Settings.
使用这些设置重新启动Grails。
Grails: Download the latest Grails release.
Grails:下载最新版本的Grails。
Life cycle events of Grails domain classes.
Grails领域类的生命周期事件。
Start up Grails if it isn't already running.
如果Grails还没有运行就启动它。
See Resources for more information on Grails.
有关Grails的更多信息,请参见参考资料。
Grails: This article USES Grails Version 1.0.3.
Grails:这篇文章使用1.0.3版本的Grails。
Then create a new user for your Grails instance.
随后为您的Grails实例创建一个新用户。
Now you are ready to run the Grails war command.
现在可以运行Grailswar命令了。
应用推荐