title: Serving static content with Jetty/Jersey/Guice
body: <p>Similar to another question (cf. <a href="https://stackoverflow.com/questions/3982005/filtering-static-content-jersey">Filtering static content Jersey</a>) I want to serve static content from Jetty.  There are several similar questions scattered all around the vast Internet, but most of them do not involve Guice, and those that do are completely out of date.</p>
  
  <p>I have an existing service that uses Jersey (1.12) and Guice (3) with the following <code>web.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"&gt;
      &lt;display-name&gt;My Service&lt;/display-name&gt;
  
      &lt;session-config&gt;
          &lt;session-timeout&gt;30&lt;/session-timeout&gt;
      &lt;/session-config&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;com.example.MyGuiceConfig&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;Guice Filter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.google.inject.servlet.GuiceFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;Guice Filter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><code>MyGuiceConfig</code> looks like so:</p>
  
  <pre><code>public class MyGuiceConfig extends GuiceServletContextListener
  {
      @Override
      protected Injector getInjector()
      {
          return Guice.createInjector(new JerseyServletModule()
          {
              @Override
              protected void configureServlets()
              {
                  bind(SomeResource.class);
                  bind(SomeDao.class).to(ConcreteSomeDao.class);
                  serve("/*").with(GuiceContainer.class);
              }
          });
      }
  }
  </code></pre>
  
  <p>When I invoke the jetty-maven-plugin using <code>mvn jetty:run</code>, my service works as expected. But, any request to static content produces a 404.</p>
  
  <p>How can I serve arbitrary static content without affecting my service? (i.e. The minimal change necessary that doesn't require me to change my tech stack?)</p>