早期的Sevlet不支持 respose.setCharacterEncoding("...")方法的解决办法
2009-03-09 10:22
531 查看
早期的Sevlet不支持 respose.setCharacterEncoding("...")方法的解决办法:
例如:tomcat4.1的sevlet.jar不支持:
response.setCharacterEncoding("UTF-8");
会导致返回给页面的值是乱码;
解决办法:
用 Respose 的另外的一个方法来代替就可以解决:
response.setContentType("text/html;charset="+"GBK"); //支持中文格式啰
例如:tomcat4.1的sevlet.jar不支持:
response.setCharacterEncoding("UTF-8");
会导致返回给页面的值是乱码;
解决办法:
用 Respose 的另外的一个方法来代替就可以解决:
response.setContentType("text/html;charset="+"GBK"); //支持中文格式啰
相关文章推荐
- response乱码 response.setCharacterEncoding("UTF-8")不生效的原因及解决方法
- JavaWeb中的乱码码问题解决,setHeader("Content-type",xxx),setCharacterEncoding()方法的区别
- response.setCharacterEncoding("UTF-8")不生效的原因及解决方法
- 关于"xampp中mysql中配置问题:Unknown initial character set index '48' received from server错误解决方法"
- Some characters cannot be mapped using "Cp1252" character encoding 解决方法
- 使用request.setCharacterEncoding("gb2312")解决中文乱码的注意事项
- C++与C函数的相互调用方法以及error C2732:链接规范与"f"的早期规范冲突的解决办法
- Some characters cannot be mapped using "ISO - 8859 -1" character encoding 解决方法
- Some characters cannot be mapped using "Cp1252" character encoding 解决方法
- 解决方法:访问接口 "SQLNCLI10" 的架构行集 "DBSCHEMA_TABLES_INFO"。该访问接口支持该接口
- 在jsp中form的onsubmit事件,onsubmit="return 方法名()",编译环境报错的解决办法
- 用 MyEciplse时 some character can not mapped using "iso-8859-1" character encoding 解决
- 对"converting to execution character set illegal sequence"错误的解决
- Mono环境下不支持Encoding.GetEncoding("GB2312")的解决方法
- 用MyEciplse时 some character can not mapped using "iso-8859-1" character encoding 解决
- 使用request.setCharacterEncoding("gb2312")解决中文乱码的注意事项
- hibernate中实体类构造方法中含有Timestamp 类型变量的"no appropriate constructor.." 错误提示的解决办法
- 使用CString的方法(以及用VC写DLL中"error LNK2005: _DllMain@12 already defined"的解决办法)
- loaded the "BlueView" nib but the view outlet was not set 错误的解决办法。
- eclipse出现 Some characters cannot be mapped using "GBK" character encoding 错误代码的解决办法