我刚刚注意到的存在grails-app/utils
目录。我从未在任何文档中看到过它(或在项目中使用过)。它是在运行时默认创建的create-app
,知道你应该在那里放什么吗?
“实用程序”代码是一个明显的猜测,但似乎应该放在src
dir.
谢谢,
大学教师
the grails-app/utils/
目录是类似项目的所在Codecs http://grails.org/doc/latest/guide/single.html#codecs go.
我不确定那里还有什么,但您可以在那里包含其他类,它们将包含在应用程序中
编辑:
这grails-app/utils/
目录用于“Grails 特定实用程序”(文物 http://grails.org/doc/latest/api/org/codehaus/groovy/grails/commons/ArtefactHandler.html, Grails类 http://grails.org/doc/latest/api/org/codehaus/groovy/grails/commons/GrailsClass.html, etc.)
杰夫·布朗(Grails开发团队核心成员 http://www.nofluffjuststuff.com/conference/speaker/jeff_brown)回复了邮件列表中的问题 http://n4.nabble.com/grails-app-utils-not-on-the-classpath-in-STS-td1355738.html这证实了这一点。他说:
你可以放任何你想放的东西
就像在utils
目录但它是
确实适用于 Grails 特定的实用程序。
此刻我唯一想的就是
真正针对这个目录的是
自定义编解码器。你的申请
不是 Grails 工件的类
应该下src/groovy/
您可以在以下位置找到新 Grails Artefact 的示例约束插件 http://www.grails.org/plugin/constraints。该插件的作者建议用户将他们的约束类放在grails-app/utils/目录 http://www.zorched.net/2009/10/26/announcing-grails-constraints-custom-domain-constraint-plugin/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)