跨域請求處理
查看後臺報錯:
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="*">