grails-app/utils 目录

标签 grails

我刚刚注意到 grails-app/utils 的存在目录我从未在任何文档(或在项目中使用)中看到它被提及。它是在您运行 create-app 时默认创建的,知道你应该在那里放什么吗?

“实用程序”代码是一个明显的猜测,但似乎应该在 src 下。目录

谢谢,
大学教师

最佳答案

grails-app/utils/目录是诸如 Codecs 之类的项目所在的位置走。

我不确定那里还有什么,但是您可以在那里包含其他类,它们将包含在应用程序中

编辑:grails-app/utils/目录用于“Grails 特定实用程序”( ArtefactsGrailsClasses 等)

Jeff Brown( Core member of the Grails development team ) 回复了 question on the mailing list这证实了这一点。他说:

You can put just about anything you like in the utils directory but it is really for Grails specific utilities. At the moment I think the only thing really targeted at this directory are custom codecs. Your application classes that are not Grails artifacts should go under src/groovy/



您可以在 Constriants plugin 中找到一个新的 Grails Artefact 示例。 .本插件作者推荐用户put their Constraint classes in the grails-app/utils/ directory .

关于grails-app/utils 目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2210241/

相关文章:

grails - 从数据库中加载Grails的选择框使其成为多选

grails - 如何从 Grails 中的 UrlMapping 中排除特定关键字?

grails - Grails 支持分片吗?

grails - 无法从Grails App中的.properties文件读取属性

grails - grails正在重新格式化我的约会

unit-testing - 如何在grails 2.2.4中模拟 Controller 中的私有(private)方法

java - 使用基于 Grails JAX-RS 插件的 RESTful API 上传文件

grails - 使用Spring安全性注释和UrlMapping来保护 Controller 的Grails

eclipse - 无法识别Grails RestBuilder插件

grails - Grails Datepicker失去了设置