在开发中,有一个很烦的问题,就是每次我们在项目里增加几行代码,然后我们企图在浏览器中查看修改后的变化时,
却发现浏览器的内容并不变化,于是我们只能通过频繁的重启tomcat来获得最新的效果,其实这么做完全没必要,我
们只需要修改下tomcat目录下conf文件夹中的context.xml中增加reloadable="true"就可以获得重启的效果。
具体修改的配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!-- The contents of this file will be loaded for each web application -->
<!-- 在此处添加reloadable="true"即可 -->
-<Context reloadable="true">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!-- <Manager pathname="" /> -->
<!-- Uncomment this to enable Comet connection tacking (provides events on session expiration as well as webapp lifecycle) -->
<!-- <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> -->
</Context>