title: How can I serve a particular classpath resource at a given address using embedded jetty?
body: <p>I'm looking to expose a clientacesspolicy.xml file from an embedded jetty server.</p>
  
  <p>My current attempt looks like this:</p>
  
  <pre><code>ContextHandler capHandler = new ContextHandler();
  capHandler.setContextPath("/clientaccesspolicy.xml");
  capHandler.setBaseResource(Resource.newClassPathResource("clientaccesspolicy.xml"));
  HandlerList handlers = new HandlerList();
  handlers.addHandler(capHandler);
  ...
  httpServer.setHandler(handlers);
  </code></pre>
  
  <p>But I get a 404 accessing <a href="http://localhost:9000/clientaccesspolicy.xml" rel="noreferrer">http://localhost:9000/clientaccesspolicy.xml</a></p>
  
  <p>How can I expose a classpath resource to a given URL programmatically in Jetty?</p>
  
  <p>Thanks,
  Andy</p>