How can I make Apache/Tomcat notice that my servlet changed, without having to restart it?

Shelleen Qian

You need to turn on Servlet Reloading on your Tomcat.

[While the below works, for Tomcat 4 another answer is simply to add the attribute reloadable="true" to the Context element for that webapp. Sometimes you don't want all contexts to be reloadable. -Alex]

To turn on servlet reloading, edit install_dir/conf/server.xml and add a DefaultContext subelement to the main Service element and supply true for the reloadable attribute. The easiest way to do this is to find the following comment:

<!-- Define properties for each web application. This is only needed if you want to set non-default properties, or have web application document roots in places other than the virtual host's appBase directory. -->

and insert the following line just below it: <DefaultContext reloadable="true"/>

Be sure to make a backup copy of server.xml before making the above change.