jsp中使用request.getParameter("XXX")中文乱码
2013-10-25 17:57
417 查看
表单提交数据中有中文
post表单jsp为user.jsp
接受表单并显示jsp为acceptuser.jsp
解决中文乱码办法
在user.jsp中将编码格式设置为gb2312
accept.jsp中编码格式不做要求情况下(如utf-8/gb2312),添加语句<%request.setCharacterEncoding("GB2312");%>
其他的试了request.getParameter("XXX").getBytes("ISO-8859-1"),"gbk"也不行,暂时解决。
以观后效。。。
post表单jsp为user.jsp
接受表单并显示jsp为acceptuser.jsp
解决中文乱码办法
在user.jsp中将编码格式设置为gb2312
accept.jsp中编码格式不做要求情况下(如utf-8/gb2312),添加语句<%request.setCharacterEncoding("GB2312");%>
其他的试了request.getParameter("XXX").getBytes("ISO-8859-1"),"gbk"也不行,暂时解决。
以观后效。。。
相关文章推荐
- JSP关于request.getParameter("");中文乱码问题
- jspsmartupload上传后 su.getRequest().getParameter("name");中文乱码
- 解决var url="xxx&参数名="+“中文参数”; 传到后台根据String x = request.getParameter("中文参数名");乱码问题
- 使用request.setCharacterEncoding("gb2312")解决中文乱码的注意事项
- JSP使用ENCTYPE="multipart/form-data"后request.getParameter无效问题Common-FileUpload组件解决方法
- 使用filter解决request.getParameter的中文乱码问题
- JSP使用ENCTYPE="multipart/form-data"后request.getParameter无效问题Common-FileUpload组件解决方法
- getServletConfig().getServletContext().getRequestDispatcher("xxx.jsp")的用法
- jsp使用request获取post传递来的参数时出现中文乱码
- java 乱码详解_jsp中pageEncoding、charset=UTF -8"、request.setCharacterEncoding("UTF-8")
- 关于(enctype="multipart/form-data") post 提交时中文乱码解决方案(使用jspsmartupload时)
- 使用JSP开发应用程序时的编码(中文等乱码)问题的建议解决方案(包括接受request和数据库操作)
- request.getRequestDispatcher("").forward()中文乱码问题
- 使用JSP开发应用程序时的编码(中文等乱码)问题的建议解决方案(包括接受request和数据库操作)
- JSP中使用XMLHttpRequest动态无刷新及其中文乱码处理
- 关于使用Ajax传中文数据到后台接受乱码问题 data:{"dictype":"客户信誉度"}
- request.getRequestDispatcher("").forward()中文乱码问题
- 使用request.getParameter()读取参数时出现的中文乱码现象
- 使用SpringMVC注解@RequestParam(value="XXX",required=false)时需要注意的问题
- jsp中关于request.getParameter中文的乱码问题