1、引用跨域包 cors-filter-2.4.jar、java-property-utils-1.9.1.jar
2、修改配置文件,路径 【tomcat安装目录】\conf\web.xml,根节点追加如下配置
3、重启tomcat生效
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>