gpt4 book ai didi

java - 在 Tomcat 7 中是否需要将 context.xml 复制到 conf/Catalina/locahost 中才能生效

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:40:30 24 4
gpt4 key购买 nike

刚从 Tomcat 6 迁移到 Tomcat 7 并注意到当您部署一个名为 widget 的 Web 应用程序时,META-INF/context.xml 不再被复制到 conf/Catalina/localhost/widget.xml。

我不清楚是否需要,如果保留在 META-INF 中,是否会使用 context.xml 中的设置,或者它们是否仅在移动到 conf/Catalina/localhost/widget.xml 时才有效

我使用的是 vanilla tomcat 7 安装

最佳答案

参见 documentation (我的重点):

Individual Context elements may be explicitly defined:

  • In an individual file at /META-INF/context.xml inside the application files. Optionally (based on the Host's copyXML attribute) this may be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to application's base file name plus a ".xml" extension.

Host 的文档在 copyXML 上有这样的话:

Set to true if you want a context XML descriptor embedded inside the application (located at /META-INF/context.xml) to be copied to xmlBase when the application is deployed. On subsequent starts, the copied context XML descriptor will be used in preference to any context XML descriptor embedded inside the application even if the descriptor embedded inside the application is more recent. The flag's value defaults to false. Note if deployXML is false, this attribute will have no effect.

关于java - 在 Tomcat 7 中是否需要将 context.xml 复制到 conf/Catalina/locahost 中才能生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12629557/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com