java后台:response.getwriter().write 乱码解决

在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数据

你可能感兴趣的:(java)