java - tomcat热部署war文件到现场

标签 java tomcat deployment tomcat7 war

来自 this blog :

All you need to do is to

  1. keep your old app foo.war untouched

  2. name your new version of app to foo##0001.war and upload to webapps folder

The old session will use foo.war, and new user will use foo##0001.war.

这是在不重启网络服务器的情况下部署新版本应用程序的最佳方式吗?字符串字面上是否正确,myApp.war 将替换为 myApp##0001。 war,这个字符串看起来很不寻常。

最佳答案

根据Tomcat 7 documentation :

The version component is treated as a String both for performance reasons and to allow flexibility in versioning schemes. String comparisons are used to determine version order. If version is not specified, it is treated as the empty string. Therefore, foo.war will be treated as an earlier version than foo##11.war and foo##11.war will be treated as an earlier version than foo##2.war. If using a purely numerical versioning scheme it is recommended that zero padding is used so that foo##002.war is treated as an earlier version than foo##011.war.

所以字符串虽然非常规,但似乎是预期的。

但我想知道:通过 Tomcat 管理,您可以在不重新启动 Tomcat 的情况下部署/取消部署 Web 应用程序。你不能用那个吗?

关于java - tomcat热部署war文件到现场,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14915545/

相关文章:

javascript - 如何在 jSTL + javascript 中使用 foreach?

java - IntelliJ 调试断点不适用于 Tomcat 运行配置

Java Servlet 抛出异常

c# - 如何在 .csproj 文件中设置 MSDeploy 设置

java - 用于为学校项目显示以下模式的 bluej 程序

java - 当我修改 session 中的实体时,hibernate 如何检测到更改

java - loadOnStartup 严重 : Servlet [dispatcher] in web application [/Producer] threw load() exception java. lang.NoSuchMethodError

java - 如果 JVM 崩溃了,Thread 还存在吗?

deployment - 让Capistrano跳过主机

git - 单文件git部署到服务器