首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Servlet中施用request.setCharacterEncoding("GB2312")

2012-08-24 
Servlet中使用request.setCharacterEncoding(GB2312)在使用request.setCharacterEncoding(gb2312)之

Servlet中使用request.setCharacterEncoding("GB2312");

在使用request.setCharacterEncoding("gb2312")之前,不能用request获取参数。

?

request.setCharacterEncoding("gb2312")此行代码必须写在最前面或者所有request.getParameter("");方法之前,如果在此前进行任何request.getPragrmber()方法都会使字符转换失效!必须要在读取request的getParameter()和 getReader() 方法之前调用 否则字符转换失效

?

void setCharacterEncoding(String env) throws UnsupportedEncodingException

?

Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.

热点排行