Java 应用引擎 - 如何从 app.yaml 发出 XML 到 web.xml

Java app engine - how to emit XML from app.yaml to web.xml

在应用程序引擎的 Java 文档中有此部分:https://cloud.google.com/appengine/docs/java/configyaml/appconfig_yaml#Java_app_yaml_Custom_XML_output

也就是说:

If you need to use features of the Java web.xml which are not directly supported in app.yaml, you can include a block of XML that will be included directly into web.xml.

但那里给出的例子似乎无关。

有谁知道如何将 XML 从 app.yaml 发射到 web.xml 吗?

只需将您的 xml 添加到 web_xml 键,请看下面的示例:

web_xml: |
  <mime-mapping>
    <extension>woff</extension>
    <mime-type>application/font-woff</mime-type>
  </mime-mapping>

上面的xml会合并到生成的web.xml