引入jar包
cors-filter-2.6 :http://central.maven.org/maven2/com/thetransactioncompany/cors-filter/2.6/cors-filter-2.6.jar
java-property-utils-1.9.1 :http://central.maven.org/maven2/com/thetransactioncompany/java-property-utils/1.9.1/java-property-utils-1.9.1.jar
在web.xml加入下面过滤器代码
CORS
com.thetransactioncompany.cors.CORSFilter
cors.allowOrigin
*
cors.supportedMethods
GET, POST
cors.supportedHeaders
Accept, Origin, X-Requested-With, Content-Type,
Last-Modified
cors.exposedHeaders
Set-Cookie
cors.supportsCredentials
true
CORS
/*