網上提供的解決方案不少,jsonp等等。java
但其實只須要在servlet添加一句話就能夠了。json
response.addHeader("Access-Control-Allow-Origin", "*");