Listing 10. Passing tests in grails.
清单10.在Grails中通过测试。
Accessing a database pool from grails.
从Grails访问数据库池。
Then, enter grails generate-controller.
然后,输入grailsgenerate-controller。
输入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 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。
The default scaffolding also serves as the source for the GSPs that get created when you type grails generate-views Trip or grails generate-all Trip.
默认搭建也是输入grailsgenerate-viewsTrip或 grails generate-all Trip时生成 GSP的来源。
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)。
Rendering JSON in a Grails controller.
在Grails控制器中呈现json。
Restart Grails with these new Settings.
使用这些设置重新启动Grails。
Grails: Download the latest Grails release.
Grails:下载最新版本的Grails。
Life cycle events of Grails domain classes.
Grails领域类的生命周期事件。
Grails: This article USES Grails Version 1.0.3.
Grails:这篇文章使用1.0.3版本的Grails。
Grails definitely satisfies the first requirement.
Grails绝对能够满足第一个要求。
This example shows how to use the filters in Grails.
本例显示了如何使用 Grails内的这些过滤器。
Restart Grails and upload the Grails logo once again.
重新启动Grails,并再次上传 Grails徽标。
This code runs when Grails executes the web.xml file.
当Grails执行这个web . xml文件时,此代码就会运行。
You will start by using the Grails command generate-app.
首先,使用Grails命令generate-app。
Grails tries to wrap each test in a database transaction.
Grails试图在数据库事务中包含所有测试。
USES Grails for some of the commercial parts of its site.
在其站点的某些商业部分使用Grails。
Logging: Learn more about logging configuration in Grails.
日志:了解关于Grails中的日志配置的更多信息。
In a Grails application, you'd create a domain class for each.
在Grails应用程序中,要为每个元素创建一个域类。
Grails supports two basic types of tests: unit and integration.
Grails支持两种基本的测试类型:单元测试和集成测试。
DK: Tool support for Groovy and Grails is constantly improving.
DK:工具对Groovy和Grails的支持一直在改进。
Listing 11. A Grails tag that works with attributes and the body.
清单11.处理属性和标记体的Grails标记。
Deploying a Grails application via Tomcat's management interface.
通过Tomcat管理接口部署Grails应用程序。
Grails offers various layout mechanisms to avoid this duplication.
Grails提供了各种布局机制来避免这种重复。
应用推荐