本文参考:http://zhidao.baidu.com/question/212618937.html
response.setCharacterEncoding("gb2312"); 在Servlet2.3中是不行的,至少要2.4版本才可以,如果低于2.4版本,可以用如下办法:
response.setContentType("text/html;charset=gb2312");
本文介绍了在不同版本的Servlet环境中如何正确设置字符集编码的方法。对于Servlet 2.4及更高版本,可以直接使用response.setCharacterEncoding('gb2312');而对于2.4以下版本,则需采用response.setContentType('text/html;charset=gb2312')的方式。
本文参考:http://zhidao.baidu.com/question/212618937.html
response.setCharacterEncoding("gb2312"); 在Servlet2.3中是不行的,至少要2.4版本才可以,如果低于2.4版本,可以用如下办法:
response.setContentType("text/html;charset=gb2312");
287
1372
8212

被折叠的 条评论
为什么被折叠?