跨域请求处理
查看后台报错:
XMLHttpRequest cannot load http://192.168.103.xx:8085/xxx/TestJsonInfo?value=1. Origin http://localhost:58888 is not allowed by Access-Control-Allow-Origin.解决办法:
1.页面请求的是自己写的一个servelet,加入response.setHeader("Access-Control-Allow-Origin", "*");
2.请求页面html,加入<meta http-equiv="Access-Control-Allow-Origin" content="*">