Marplesoft
Marplesoft

Reputation: 6240

What's an easy, quick way to reload a webapp in tomcat in dev environment?

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 has a redeploy option, but just wondering if there's a native app that would do this a bit quicker and nicer?

Upvotes: 13

Views: 18794

Answers (2)

Carl Smotricz
Carl Smotricz

Reputation: 67820

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.

Upvotes: 16

Pascal Thivent
Pascal Thivent

Reputation: 570595

Just 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 is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

Upvotes: 16

Related Questions