This page is offered as a service of Bristle Software, Inc. New tips are sent to an associated mailing list when they are posted here. Please send comments, corrections, any tips you'd like to contribute, or requests to be added to the mailing list, to tips@bristle.com.
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
There are several ways to deploy a Webapp in Tomcat:
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
To cause Tomcat to check for and load updated code for a Webapp, edit the <Context> element of the context configuration file, setting the reloadable attribute of the Context element to "true", as:
<Context docBase="/home/fred/bristle/webapps/mywebapp/web"
path="/mywebapp"
reloadable="true"
>
</Context>
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
To cause Tomcat to check for and load updated code for all Webapps by default,
add a <DefaultContext> element to the main Tomcat server.xml
file:
.../conf/server.xml
setting the reloadable
attribute of the Default Context element to "true", as:
<DefaultContext reloadable="true"/>
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
To cause Tomcat to more frequently (every 10 seconds in this case) check for and load code for a Webapp, add a <Loader> element to the <Context> element of the context configuration file, as:
<Context docBase="/home/fred/bristle/webapps/mywebapp/web"
path="/mywebapp"
reloadable="true">
<Loader
checkInterval="10" />
</Context>
You may not want to do this for a production server, since it wastes unnecessary CPU cycles in an environment where files do not change often, but it's very handy on a development server.
--Fred
©Copyright 2006-2008, Bristle Software, Inc. All rights reserved