在response.getwriter().write的上面需要设置:
response.setContentType(“text/html; charset=utf-8”); html
response.setContentType(“text/plain; charset=utf-8”); 文本
response.setContentType(“text/JavaScript; charset=utf-8”); json数据
response.setContentType(“application/xml; charset=utf-8”); xml数据