【问题标题】:How does Grails merge the config.groovy with the static web.xml file?Grails 如何将 config.groovy 与静态 web.xml 文件合并?
【发布时间】:2013-05-19 23:51:23
【问题描述】:

Grails 允许您生成静态 web.xml 文件,其中包含:

 grails install-templates

当您编辑生成的 web.xml 文件并添加更改 config.groovy 时,Grails 在编译时会做什么?既然可以在 config.groovy 中指定 web.xml 相关配置,这些文件是如何合并到最终的 web.xml 文件中的呢?

【问题讨论】:

    标签: grails web.xml grails-2.0


    【解决方案1】:

    Grails 有一个打包阶段,它将完成创建最终web.xml 文件所需的工作。如果我没记错的话,这是由GrailsProjectPackager#generateWebXml(GrailsPluginManager pluginManager) 完成的。

    此过程还将查看您已安装的插件,这些插件可以在文件中应用自定义,尽管 doWithWebDescriptor 闭包。你可以check it on Github

    【讨论】:

    • 当我在 config.groovy 和我的静态 web.xml 中更改某些变量时,Grails 将采用哪个值?
    猜你喜欢
    • 1970-01-01
    • 2013-05-26
    • 2012-12-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多