title: How to set the cross domain policy with embedded jetty ? RESTserver
body: <p>I would like to know the way to set the cross domain policy, is that with filters or with the web.xml? How can I add it ? I'm using jetty and jersey.</p>
  
  <p>Here's my main</p>
  
  <pre><code>   public static void main(String[] args) throws Exception {
  
       Server server = new Server(8080);
       ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
       context.setContextPath("/");
       context.addServlet(org.eclipse.jetty.servlet.DefaultServlet.class, "/");
       context.setResourceBase(".");
       server.setHandler(context);
  
       ServletHolder jerseyServlet = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, "/*");
       jerseyServlet.setInitOrder(0);
  
       jerseyServlet.setInitParameter("jersey.config.server.provider.packages", "my.package.rest");
       server.start();
       server.join();    
    }
  </code></pre>
  
  <p>my web.xml</p>
  
  <pre><code>&lt;web-app&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;cross-origin&lt;/filter-name&gt;
      &lt;filter-class&gt;org.eclipse.jetty.servlets.CrossOriginFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;cross-origin&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>Did I miss something ?</p>