I'm running Tomcat 6 on Windows. I've got the "Monitor Tomcat" system tray icon which allows me to start and shutdown Tomcat, but is there another little tool that allows me to easily reload my web app when I've changed the class files? I know the "manager" app that comes with Tomcat does this but just wondering if there's a native app that would do this a bit quicker and nicer?
views:
184answers:
2Just add a reloadable=true
attribute to the Context
. Quoting the documentation:
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 isfalse
. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
Assuming you've already set reloadable=true
, you can touch
either the war file in the webapps directory, or a monitored file such as WEB-INF/web.xml in the exploded application directory. This will update the time stamp and make the app look new, so it will be reloaded.
At our company, we run our Web app servers in dev mode all the time just to facilitate this. To hell with the recommendation, we know better than to run our app on 99% load so we can't spare a few cycles.