title: Jetty Cross Origin Filter
body: <p>I've configured Jetty's cross origin filter, but I continue to get the following error. Does anyone know what is wrong and how to fix it? Below the error message is my override descriptor (i.e. supplemental web.xml)</p>
  
  <p><strong>Error:</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Origin http://localhost:8090 is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p><strong>Override Descriptor:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!DOCTYPE web-app PUBLIC
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  
  &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;init-param&gt;
         &lt;param-name&gt;allowedOrigins&lt;/param-name&gt;
         &lt;param-value&gt;*&lt;/param-value&gt;
     &lt;/init-param&gt;
     &lt;init-param&gt;
         &lt;param-name&gt;allowedMethods&lt;/param-name&gt;
         &lt;param-value&gt;*&lt;/param-value&gt;
     &lt;/init-param&gt;
     &lt;init-param&gt;
         &lt;param-name&gt;allowedHeaders&lt;/param-name&gt;
         &lt;param-value&gt;*&lt;/param-value&gt;
     &lt;/init-param&gt;
   &lt;/filter&gt;
   &lt;filter-mapping&gt;
       &lt;filter-name&gt;cross-origin&lt;/filter-name&gt;
       &lt;filter-pattern&gt;/*&lt;/filter-pattern&gt;
   &lt;/filter-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>Request Header</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Accept:*/*
  Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:en-US,en;q=0.8
  Access-Control-Request-Headers:Origin, Content-Type, Accept
  Access-Control-Request-Method:POST
  Connection:keep-alive
  Host:localhost:8080
  Origin:http://localhost:8090
  Referer:http://localhost:8090/home
  User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.942.0
  </code></pre>
  
  <p><strong>Response Header</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Allow:POST,GET,OPTIONS,HEAD
  Content-Length:0
  Date:Wed, 30 Nov 2011 02:13:21 GMT
  Server:Jetty(7.5.4.v20111024)
  </code></pre>