首页 > 技术文章 > Access-Control-Allow-Origin

qingmaple 2016-11-09 17:26 原文

*

XMLHttpRequest cannot load http:/XXX. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

---

下载cors-filter-1.7.jar,java-property-utils-1.9.jar这两个库文件,放到lib目录下。(可在http://search.maven.org上查询并下载。)工程项目中web.xml中的配置如下: 

*

推荐阅读