title: Embedded Jetty+Jersey cannot get static resource
body: <p>I write a <code>jettyserver.java</code> as start service,here is the code,</p>
  
  <pre><code>public class jettyserver {
  public static void main(String[] args) throws Exception {
      Server server = new Server(8080); 
      ServletHolder servletHolder = new ServletHolder(ServletContainer.class);
      Map&lt;String, String&gt; parameterMap = new HashMap&lt;String, String&gt;();
      parameterMap.put("jersey.config.server.provider.packages", "com.heu.cs.mavenproject3");
      servletHolder.setInitParameters(parameterMap); 
      ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);  
      context.setContextPath("/jettyproject/*");
      context.addServlet(servletHolder, "/*");
      server.setHandler(context);
      server.start();
      server.join();
      }
  }
  </code></pre>
  
  <p>And I write a <code>demo.java</code> as a test demo,</p>
  
  <pre><code>@Path("/demo")
  public class demo {
  @GET
  @Produces({"text/html"})
  public String index(){
      return "OK";
      }
  }
  </code></pre>
  
  <p>and then i run <code>jettyserver.java</code>,I got OK like:</p>
  
  <p><a href="https://i.stack.imgur.com/DQjHg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DQjHg.png" alt="this"></a></p>
  
  <p>we can see OK,that's right
  but wen I enter localhost:8080/jettyproject/index.html or localhost:8080/index.html in the browser, I got a 404 error like this: </p>
  
  <p><a href="https://i.stack.imgur.com/x6IMq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x6IMq.png" alt="404 Error"></a></p>
  
  <p><strong>what should I do ? What'wrong with the code????</strong></p>