title: Configure static resource folder external to web app in jetty 8
body: <p>I am having a static resource folder external to the web application and am trying to configure it in Jetty 8. So far I have tried the following.</p>
  
  <p>1) I have added a context handler in jetty xml as following:</p>
  
  <pre><code>    &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="context" class="org.eclipse.jetty.server.handler.ContextHandler"&gt;
           &lt;Set name="resourceBase"&gt;&lt;SystemProperty name="JETTY_HOME" default="."/&gt;/static/&lt;/Set&gt;
          &lt;/New&gt;
        &lt;/Item&gt;
         &lt;Item&gt;
           &lt;New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/&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;
  </code></pre>
  
  <p>and I have placed static folder in inside jetty-distribution folder.</p>
  
  <p>I have also tried placing the static folder as static.war inside the webapps folder and it is not accessible with /static.</p>
  
  <p>2) I have tried adding/changing the xml in the /contexts folder in the jetty distribution. Even that doesnt work.</p>
  
  <p>Also, in my jetty-web.xml I have a webappcontext registered as below:</p>
  
  <pre><code>&lt;Configure class="org.eclipse.jetty.webapp.WebAppContext"&gt;
   &lt;Call class="org.eclipse.jetty.util.log.Log" name="debug"&gt;
      &lt;Arg&gt;executing jetty-web.xml&lt;/Arg&gt;
   &lt;/Call&gt;
   &lt;Set name="contextPath"&gt;/security&lt;/Set&gt;
   &lt;/Configure&gt;
  </code></pre>
  
  <p>My static resource structure is as follows.</p>
  
  <pre><code>   static
       -css
         - &lt;all css files&gt;
       -images
         - &lt;further folders and images&gt;
       -js
         - &lt;all js files&gt;
  </code></pre>
  
  <p>I am new to jetty, and started working in it from past few days. Any help is really appreciated.</p>
  
  <p>Thanks</p>