title: How to configure Jetty to reload a WebAppContext when classes are changed
body: <p>I'm developing a web application and I run Jetty as the development and testing environment when I develop under Eclipse.</p>
  
  <p>When I make changes to Java classes, Eclipse automatically compiles them to the build directory, but Jetty won't see the changes until I stop and start the server. I know that Jetty supports "hot deployment" using ContextDeployer that will refresh updated application contexts, but it relies on a context file in a context directory being updated - which is not very useful in my case.</p>
  
  <p>Is there a way to set up Jetty so that it will reload the web app when any of the classes it uses is updated?</p>
  
  <p>My current jetty.xml looks something like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"&gt;
      &lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
          &lt;Set name="ThreadPool"&gt;&lt;!-- bla bla --&gt;&lt;/Set&gt;
          &lt;Call name="addConnector"&gt;&lt;!-- bla bla --&gt;&lt;/Call&gt;
          &lt;Set name="handler"&gt;
            &lt;New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"&gt;
              &lt;Set name="handlers"&gt;
               &lt;Array type="org.eclipse.jetty.server.Handler"&gt;
                 &lt;Item&gt;
                   &lt;New id="webapp" class="org.eclipse.jetty.webapp.WebAppContext"&gt;
                     &lt;Set name="displayName"&gt;My Web App&lt;/Set&gt;
                     &lt;Set name="resourceBase"&gt;src/main/webapp&lt;/Set&gt;
                     &lt;Set name="descriptor"&gt;src/main/webapp/WEB-INF/web.xml&lt;/Set&gt;
                     &lt;Set name="contextPath"&gt;/mywebapp&lt;/Set&gt;
                   &lt;/New&gt;
                 &lt;/Item&gt;
                 &lt;Item&gt;
                   &lt;New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/&gt;
                 &lt;/Item&gt;
               &lt;/Array&gt;
              &lt;/Set&gt;
            &lt;/New&gt;
          &lt;/Set&gt;
      &lt;/Configure&gt;
  </code></pre>