title: Tomcat API unreachable from angular
body: <p>After moving from 'localhost' to online server, I incur in this error
   403 because of CORS.</p>
  
  <p>The api is reachable from url and It works, but when I call it with my
   angular Typescript page, It doesen't work, giving me this error:</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 403 ()</p>
    
    <p>Access to XMLHttpRequest at
    '<a href="http://_._._._:8080/bet365/elencoEventi/2019-02-20" rel="nofollow noreferrer">http://<em>.</em>.<em>.</em>:8080/bet365/elencoEventi/2019-02-20</a>' from origin
    '<a href="http://127.0.0.1:8000" rel="nofollow noreferrer">http://127.0.0.1:8000</a>' has been blocked by CORS policy: No
    'Access-Control-Allow-Origin' header is present on the requested
    resource.</p>
  </blockquote>
  
  <p>I tried to add filters in tomcat, like this :</p>
  
  <pre><code>&lt;filter&gt;
    &lt;filter-name&gt;CorsFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;org.apache.catalina.filters.CorsFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;CorsFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>But it is still giving me the 403 error.</p>