网上提供的解决方案不少,jsonp等等。java
但其实只须要在servlet添加一句话就能够了。json
response.addHeader("Access-Control-Allow-Origin", "*");