修改 TOMCAT_HOME/conf/server.xml 文件,添加 <Context> 标签让指定的 web 应用程序自动重载。内容如下:
自动重载的配置:
修改$tomcat_home/conf/server.xml文件,在host节点下 加入Context 例如:
Xml代码
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/test" docBase="test" debug="0" privileged="true" reloadable="true"/ >
</Host>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/test" docBase="test" debug="0" privileged="true" reloadable="true"/ >
</Host>
这样方便开发的时候,每次更改class后,去重启tomcat