当前位置:首页 > 资讯 > info6 > 正文

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '

发表于: 2016-07-13   作者:bsh_csn   来源:转载   浏览:
摘要: No‘Access-Control-Allow-Origin’headerispresentontherequestedresource.Origin‘http://9.1.101.112:8080’isthereforenotallowedaccess.问题存在与两个不同的tomcat下的项目互相调用方法时出现:即ajax跨域解决办法:在请求的java方法中加入以下代码即可response.se

No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://9.1.101.112:8080’ is therefore not allowed access. 问题

存在与两个不同的tomcat下的项目互相调用方法时出现: 即 ajax跨域

解决办法:

在请求的java方法中加入 以下代码即可

response.setHeader("Access-Control-Allow-Origin", "*");

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号