tomcat - 在tomcat中禁用特定 war 的加载

标签 tomcat web war

tomcat 中是否有可用的配置,我需要禁用特定 war 的加载。

问候,

拉格万

最佳答案

server.xml 中查找 Host 元素。向其添加具有适当值的 deployIgnore 属性。
值为

A regular expression defining paths to ignore when autoDeploy and deployOnStartup are set.
...
This regular expression is relative to appBase. It is also anchored, meaning the match is performed against the entire file/directory name. So, foo matches only a file or directory named foo but not foo.war, foobar, or myfooapp. To match anything with "foo", you could use .*foo.*.

所以例如你可以指定类似的东西

<Host name="localhost"  appBase="webapps" deployIgnore="yourApp(.war)?"
        unpackWARs="true" autoDeploy="true">
    ...        
</Host>

参见 documentation .

关于tomcat - 在tomcat中禁用特定 war 的加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38806587/

相关文章:

html - 边界问题

maven-2 - 如何要求 maven war 插件将特定的 jar 文件复制到 warfile/web-inf/lib

Grails - 仅用于 war 构建的消息包 (i18n)

apache - 带有tomcat7的mod_proxy在上传文件时给出错误502

java - Tomcat的上下文层次结构

web - 在 Service Stack REST API 服务中使用 SignalR

tomcat - 在 Tomcat 中部署 WAR 时打印自定义消息

tomcat - Windows 10 上的 Spring STS Spring Tools Suite 端口问题 Tomcat

apache - Tomcat 的 JSP 错误

java - GAE 中的 userservicefactory 是否仅适用于拥有 g-mail 帐户的用户?