首页 > 其他 > 详细

<J2EE>Response 后使用Write写的中文是乱码

时间:2014-11-16 20:14:02      阅读:270      评论:0      收藏:0      [点我收藏+]

在使用servlet输出中,使用如下代码response设置输出格式无效,发现怎么改都是乱码。

PrintWriter out = response.getWriter();
		response.setContentType("text/html;charset=GB2312");

 后来发现,设置格式位置不对,应该 设置在前使用在后,如下

response.setContentType("text/html;charset=GB2312");
PrintWriter out = response.getWriter();


<J2EE>Response 后使用Write写的中文是乱码

原文:http://my.oschina.net/anyyang/blog/345282

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!