title: CORS Filter is not changing my header
body: <p>I have a maven project (with web and JPA facets) in Eclipse Java EE IDE for Web Developers. I have added the jars to my tomcat library and everything compiles great. </p>
  
  <p><strong>However, my webpage header does NOT reflect what I have enabled in my web.xml through the <a href="http://software.dzhuvinov.com/cors-filter.html" rel="nofollow noreferrer">CORS filter</a>.</strong></p>
  
  <p>My header looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/xyMV3.png" alt="enter image description here"></p>
  
  <p>And my web.xml contains:</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_3_0.xsd"
  version="3.0"&gt;
  
  &lt;!-- Servlet 1: Expose the OData service endpoint --&gt;
  &lt;servlet&gt;
  &lt;servlet-name&gt;OData&lt;/servlet-name&gt;
  &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
  
  &lt;!-- all additional parameters will be passed to your factory create method --&gt;
  &lt;init-param&gt;
    &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
    &lt;param-value&gt;org.odata4j.jersey.producer.resources.ODataApplication&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
      &lt;param-name&gt;odata4j.producerfactory&lt;/param-name&gt;
      &lt;param-value&gt;org.odata4j.producer.jpa.JPAProducerFactory&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
    &lt;param-name&gt;odata4j.jpa.persistenceUnitName&lt;/param-name&gt;
    &lt;param-value&gt;Resource&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;OData&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/example.svc/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;!-- Servlet 2: Enable crossdomain access for browser clients --&gt;
  &lt;servlet&gt;
  &lt;servlet-name&gt;CrossDomain&lt;/servlet-name&gt;
  &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
  &lt;init-param&gt;
    &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
    &lt;param-value&gt;org.odata4j.producer.resources.RootApplication&lt;/param-value&gt;
  &lt;/init-param&gt;
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;CrossDomain&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  &lt;!--  Use CORSFilter for CORS --&gt;
  &lt;filter&gt;
  &lt;filter-name&gt;CORS&lt;/filter-name&gt;
  &lt;filter-class&gt;com.thetransactioncompany.cors.CORSFilter&lt;/filter-class&gt;
  &lt;!-- Note: All parameters are options, if ommitted CORS Filter
     will fall back to the respective default values.
  --&gt;
  &lt;init-param&gt;
  &lt;param-name&gt;cors.allowGenericHttpRequests&lt;/param-name&gt;
  &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
  &lt;param-name&gt;cors.allowOrigin&lt;/param-name&gt;
  &lt;param-value&gt;*&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
  &lt;param-name&gt;cors.supportedMethods&lt;/param-name&gt;
  &lt;param-value&gt;GET, HEAD, POST, OPTIONS, PUT, DELETE&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
  &lt;param-name&gt;cors.supportedHeaders&lt;/param-name&gt;
  &lt;param-value&gt;Content-Type, X-Requested-With, Accept, Authentication&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
  &lt;param-name&gt;cors.exposedHeaders&lt;/param-name&gt;
  &lt;param-value&gt;X-Test-1, X-Test-2&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
  &lt;param-name&gt;cors.supportsCredentials&lt;/param-name&gt;
  &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;init-param&gt;
  &lt;param-name&gt;cors.maxAge&lt;/param-name&gt;
  &lt;param-value&gt;3600&lt;/param-value&gt;
  &lt;/init-param&gt;
  
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
  &lt;filter-name&gt;CORS&lt;/filter-name&gt;
  &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>