工程文件修改后Tomcat容器重启问题
在Eclipse中部署工程之Tomcat容器中,若代码有改动,一不小心按了save,则Tomcat就会重启,对于较大的工程很不方便。
配置方法,Tomcat配置文件server.xml中,Context元素reloadable属性设置为false
<Context docBase="helloWeb" path="/helloWeb" reloadable="false"
Tomcat官网对该属性介绍:https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Attributes
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 is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
如果该属性为true,Catalina会监视/WEB-INF/classes/与/WEB-INF/lib下的变化,如果有变化则重启web
一些其他的参考:
http://blog.knowsky.com/186994.htm
热部署 热加载 Debug模式
http://www.huihoo.org/apache/tomcat/
http://www.blogjava.net/wangxinsh55/archive/2011/05/31/351449.html