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/