这可能是显而易见的,但我找不到任何详细信息。在观看关于 tomcat 7 的视频后,提到可以在处理完 Web 应用程序中的所有注释后记录最终的 web.xml。此时,您可以将 metadata-complete 设置为 true 并使用 web.xml 进行生产,从而提高性能。我对一个带注释的 servlet 进行了快速测试,但我没有在日志(或与此相关的任何其他地方)中看到任何生成的 web.xml。我想我错过了什么。有人设法做到这一点吗?
最佳答案
好的,
我找到了答案,我似乎在 docs 中遗漏了这个:
logEffectiveWebXml - Set to true if you want the effective web.xml used for a web application to be logged (at INFO level) when the application starts. The effective web.xml is the result of combining the application's web.xml with any defaults configured by Tomcat and any web-fragment.xml files and annotations discovered. If not specified, the default value of false is used.
因此,这是定义上下文并将此属性设置为 true 的情况。我会试一试,让您知道我的进展情况。
关于java - Tomcat 7 log 有效web.xml的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6711834/