怎么让servlet接口支持前端的跨域请求,
doPost中加了如下代码,仍然不行,不知道是前端问题,还是servlet问题....
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "*");
response.setHeader("Access-Control-Max-Age", "3600");
response.addHeader("Access-Control-Allow-Headers", "*");
response.setHeader("Access-Control-Allow-Credentials", "*");