简体   繁体   English

Tomcat server.xml位置

[英]Tomcat server.xml locations

I was wondering if it would be possible to add a server.xml into a META-INF folder for tomcat to use. 我想知道是否有可能将server.xml添加到META-INF文件夹中以供tomcat使用。 I know that this is possible for the context.xml. 我知道这对于context.xml是可能的。 If this is not possible are there any ways, project side, to add a resource to the server.xml. 如果这不可能,那么在项目方面,有任何方法可以将资源添加到server.xml。 The reason I am curious is because if this is possible it would make my general tomcat server.xml cleaner and would make deployments much smoother. 我很好奇的原因是,如果可能的话,它将使我的常规tomcat server.xml更加整洁,并使部署更加平滑。 If there are any clarifications that are needed just ask. 如果需要任何澄清,请询问。

Or would it be possible to have the equivalent of a resource in the context.xml? 还是有可能在context.xml中具有等效的资源?

Turns out the server.xml file can be thought of as being a global version of the context.xml and cannot be overriden. 原来,server.xml文件可以被认为是context.xml的全局版本,不能被覆盖。 So to add a resource you just add it to the context.xml like you would the server. 因此,要添加资源,只需像将服务器一样将其添加到context.xml中即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM