I'm running Tomcat 6 on Windows. I've got the "Monitor Tomcat" system tray icon which allows me to start and shutdown Tomcat, but is there another little tool that allows me to easily reload my web app when I've changed the class files? I know the "manager" app that comes with Tomcat has a redeploy option, but just wondering if there's a native app that would do this a bit quicker and nicer?
我在Windows上运行Tomcat 6。我已经有了“监控Tomcat”系统托盘图标,它允许我启动和关闭Tomcat,但是还有什么小工具可以让我在更改类文件时轻松地重新加载web应用程序吗?我知道Tomcat附带的“管理器”应用程序有一个重新部署选项,但我想知道是否有一个本地应用程序可以更快更好地完成这个任务?
2 个解决方案
#1
13
Just add a reloadable=true
attribute to the Context
. Quoting the documentation:
只需向上下文添加一个reloadable=true属性。引用的文档:
Set to
true
if you want Catalina to monitor classes in/WEB-INF/classes/
and/WEB-INF/lib
for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute isfalse
. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.如果您想让Catalina监视/ web - inf /classes/和/ web - inf /lib中的类以查看更改,则将其设置为true,并在检测到更改时自动重新加载web应用程序。这个特性在应用程序开发过程中非常有用,但是它需要大量的运行时开销,不建议在部署的生产应用程序中使用。这就是为什么这个属性的默认设置是false。不过,您可以使用Manager web应用程序按需触发已部署应用程序的重新加载。
#2
15
Assuming you've already set reloadable=true
, you can touch
either the war file in the webapps directory, or a monitored file such as WEB-INF/web.xml in the exploded application directory. This will update the time stamp and make the app look new, so it will be reloaded.
假设您已经设置reloadable=true,您可以触摸webapps目录中的war文件,也可以触摸web - inf /web等受监视文件。爆炸应用程序目录中的xml。这将更新时间戳,使应用程序看起来更新,因此它将被重新加载。
At our company, we run our Web app servers in dev mode all the time just to facilitate this. To hell with the recommendation, we know better than to run our app on 99% load so we can't spare a few cycles.
在我们公司,我们一直在dev模式下运行我们的Web应用服务器,以促进这一点。让推荐见鬼去吧,我们知道最好在99%的负载下运行我们的应用程序,这样我们就不能浪费几个周期了。
#1
13
Just add a reloadable=true
attribute to the Context
. Quoting the documentation:
只需向上下文添加一个reloadable=true属性。引用的文档:
Set to
true
if you want Catalina to monitor classes in/WEB-INF/classes/
and/WEB-INF/lib
for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute isfalse
. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.如果您想让Catalina监视/ web - inf /classes/和/ web - inf /lib中的类以查看更改,则将其设置为true,并在检测到更改时自动重新加载web应用程序。这个特性在应用程序开发过程中非常有用,但是它需要大量的运行时开销,不建议在部署的生产应用程序中使用。这就是为什么这个属性的默认设置是false。不过,您可以使用Manager web应用程序按需触发已部署应用程序的重新加载。
#2
15
Assuming you've already set reloadable=true
, you can touch
either the war file in the webapps directory, or a monitored file such as WEB-INF/web.xml in the exploded application directory. This will update the time stamp and make the app look new, so it will be reloaded.
假设您已经设置reloadable=true,您可以触摸webapps目录中的war文件,也可以触摸web - inf /web等受监视文件。爆炸应用程序目录中的xml。这将更新时间戳,使应用程序看起来更新,因此它将被重新加载。
At our company, we run our Web app servers in dev mode all the time just to facilitate this. To hell with the recommendation, we know better than to run our app on 99% load so we can't spare a few cycles.
在我们公司,我们一直在dev模式下运行我们的Web应用服务器,以促进这一点。让推荐见鬼去吧,我们知道最好在99%的负载下运行我们的应用程序,这样我们就不能浪费几个周期了。