title: How do I filter all incoming requests and not just ones mapped to servlets?
body: <p>I am toying around with embedded Jetty and I am wondering why my filter <em>only</em> intercepts <code>/hi</code> and not any other incoming request. Here is my example case:</p>
  
  <p>Without Filter:</p>
  
  <pre><code>localhost:8080/hi
  =&gt; "Hello"
  localhost:8080/foo
  =&gt; 404
  </code></pre>
  
  <p>With Filter:</p>
  
  <pre><code>localhost:8080/hi
  =&gt; "Hello from filter"
  localhost:8080/foo
  =&gt; 404
  </code></pre>
  
  <p>I would expect the last 404 to return "Hello from filter". What am I missing?</p>
  
  <pre><code>Server server=new Server(8080);
  
  ServletContextHandler context=
      new ServletContextHandler(ServletContextHandler.SESSIONS);
  
  context.setContextPath("/");
  context.addFilter(DispatchFilter.class,"/*",1);
  context.addServlet(HelloServlet.class,"/hi");
  
  server.setHandler(context);
  server.start();
  server.join();
  </code></pre>
  
  <p>To further clarify, my example is just a simplified representation of what I want to do. My intention is to have the <code>DispatchFilter</code> intercept every request. If a certain criteria is not met, then it should move on, otherwise return something derived from the request path.</p>