Tomcat can only "hot" replace a certain type of file, such as JSP , and static files, such as JavaScript, CSS, etc. If you disable caching , but cannot "hot" replace Java classes, restart webapp. To achieve a hot exchange of Java classes, Ive seen JRebel ads all over the world, but have not tried their product.
However, you could save the Tomcat session by commenting on the directive as described on the Tomcat documentation site: http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Disable_Session_Persistence .
Finally, you can write an ANT script to build the WAR and redeploy each time the script runs.
Example build.xml:
... <target name="tomcat-stop"> <exec executable="${server.home}/bin/catalina.bat"> <arg value="stop"/> </exec> </target> <target name="tomcat-start"> <exec executable="${server.home}/bin/startup.bat"> <arg value="start"/> </exec> </target> ... <target name="all" depends="tomcat-stop,clean,init,compile,junit-slow,make_war,deploy,tomcat-start"></target>
In any consolidation, I would avoid using the Eclipse Tomcat Plugin for two reasons.
- Most versions of Eclipse already have Tomcat as a server adapter and come with some options.
- Prevent IDE bloat with plugins.
user5012277 Sep 09 '15 at 2:49 2015-09-09 14:49
source share