title: How to use swagger-ui with service deployed in tomcat running on eclipse
body: <p>I have a REST api running at <code>http://localhost:8080/MyService</code> and can see the JSON produced by swagger at <code>http://localhost:8080/MyService/api-docs</code>. In the Servers project in eclipse I have modified web.xml to include the Cors filter:</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 when I point swagger-ui (loaded in browser from file system) at <code>http://localhost:8080/MyService/api-docs</code>, I get the following error:</p>
  
  <blockquote>
    <p>Can't read from server. It may not have the appropriate
    access-control-origin settings.</p>
  </blockquote>