需要在web工程中的web。xml中增加如下配置
<!-- ***注:如出现找不到CORSFilter对应类 在built path中 加入 cors-filter-1.7 java-property-utils-1.9 两个jar包-->
<filter>
CorsFilter
com.thetransactioncompany.cors.CORSFilter
CorsFilter
/*
并且增加两个jar包
cors-filter-1.7.jar
java-property-utils-1.9.jar