Sun Java System Web Server 6.1 SP6 Programmer's Guide to Web Applications

Dynamic Reloading of Web Applications

If you make code changes to a web application and dynamic reloading is enabled, you do not need to redeploy the web application or restart the server.

To enable dynamic reloading, you must edit the following attribute of the server.xml file's JAVA element, then restart the server:


where integer specifies the interval (in seconds) after which a deployed application will be checked for modifications and reloaded if necessary. To enable dynamic reloading, you must specify a value greater than 0.

The server.xml setting is the default value for all applications. An individual application can override the value for dynamicreloadinterval by specifying a value to the class-loader element in the sun-web.xml file.

For information about sun-web.xml, see the section, The sun-web-app_2_3-1.dtd File Server 6.1 Administrator's Configuration File Reference.

ProcedureTo load new servlet files or reload deployment descriptor changes

  1. Create an empty file named .reload at the root of the deployed module. For example:


    where vs_id is the virtual server ID in which the web application is deployed, and uri is the value of the uri attribute of the <WEBAPP> element.

  2. Explicitly update the .reload file's timestamp (touch .reload in UNIX) each time you make the above changes.

    For JSPs, changes are reloaded automatically at a frequency set in the reload-interval property of the jsp-config element in the sun-web.xml file. To disable dynamic reloading of JSPs, set the reload-interval property to -1.