title: Adding filter to guice servlet
body: <p>I created a servlet using guice servet which works fine:</p>
  
  <pre><code>protected Injector getInjector() {
      return Guice.createInjector(new ServletModule() {
          protected void configureServlets() {
              bind(MyService.class).to(MyServiceImpl.class);
              serve("/myservlet").with(MyServlet.class);
          }
      });
  }
  </code></pre>
  
  <p>My servlet looks like this:</p>
  
  <pre><code>@Inject
  private MyService myService;
  
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      response.getWriter().print(myService.hello("John Doe").toString());
  }
  </code></pre>
  
  <p>Now I am trying to add a filter to it like thing:</p>
  
  <pre><code>            bind(MyService.class).to(MyServiceImpl.class);
              filter("/*").through(MyFilter.class);
              serve("/myservlet").with(MyServlet.class);
  </code></pre>
  
  <p>My filter looks like this:</p>
  
  <pre><code>@Singleton public class MyFilter implements Filter { 
      public void init(FilterConfig filterConfig) throws ServletException { } 
      public void doFilter(ServletRequest request, 
                           ServletResponse response,
                           FilterChain chain) throws IOException, ServletException {
          System.out.println("Yeah"); 
      } 
      public void destroy() { }
  }
  </code></pre>
  
  <p>As soon as I add the filter the servlet does not get called any more.</p>
  
  <p>When I remove the filter the servlet works again.</p>
  
  <p>What am I doing wrong?</p>