7
我正在创建一个Grails插件,我想为它添加自己的UrlMappings。插件源中的UrlMappings.groovy
文件被使用该插件的应用程序忽略,因此应在何处定义这些文件?Grails插件如何添加自己的URLMappings?
我正在创建一个Grails插件,我想为它添加自己的UrlMappings。插件源中的UrlMappings.groovy
文件被使用该插件的应用程序忽略,因此应在何处定义这些文件?Grails插件如何添加自己的URLMappings?
见http://grails.org/doc/latest/guide/single.html#plugins:Notes on excluded Artefacts
In addition, although UrlMappings.groovy is excluded
you are allowed to include a UrlMappings definition with
a different name, such as MyPluginUrlMappings.groovy.
它没有为我工作。 当我运行主项目时,我得到'ERROR commons.DefaultGrailsApplication - 尝试加载Grails应用程序时找不到类[MyPluginUrlMappings]。跳过。“# – 2012-01-24 19:15:10
@CassioLandim您的课程名称必须是”MyPluginUrlMappings“而不是”UrlMappings“。 – 2013-09-24 17:41:58
@CassioLandim感谢你的评论。我忘了它是一个类,并有一个类定义... – Spider 2013-12-20 12:10:43