怎样让Tomcat告别频繁重启?


  在网站开发过程中,有一个很烦的问题就是每次我们在项目里增加几行代码,然后我们企图在浏览器中查看修改后的变化时,却发现浏览器的内容并不变化,于是我们只能通过频繁的重启tomcat来获得最新的效果,其实这么做完全没必要,我们只需要修改下tomcat目录下conf文件夹中的context.xml中增加reloadable="true"就可以获得重启的效果。

  具体修改的配置如下:

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2.   
  3. <!-- The contents of this file will be loaded for each web application -->  
  4.   
  5. <!-- 在此处添加reloadable="true"即可 -->  
  6. -<Context reloadable="true">  
  7. <!-- Default set of monitored resources -->  
  8.  <WatchedResource>WEB-INF/web.xml</WatchedResource>  
  9. <!-- Uncomment this to disable session persistence across Tomcat restarts -->  
  10.    
  11. <!-- <Manager pathname="" /> -->  
  12.    
  13. <!-- Uncomment this to enable Comet connection tacking (provides events on session expiration as well as webapp lifecycle) -->  
  14.    
  15. <!-- <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> -->  
  16.  </Context>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM