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