post方式提交request.getParamter();乱码解决方法
2014-03-14 16:43
246 查看
首先要在doPost()方法里面注明编码request的编码方式:request.setCharacterEncoding("utf-8");或request.setCharacterEncoding("gbk");
如果还不行,就要给单独request的属性进行重新编码:例:String name= new String(request.getParameter("name").getBytes("ISO-8859-1"),"utf-8") ;
这样就可以了。
如果还不行,就要给单独request的属性进行重新编码:例:String name= new String(request.getParameter("name").getBytes("ISO-8859-1"),"utf-8") ;
这样就可以了。
相关文章推荐
- 表单通过get和post方式提交数据解决乱码的方法
- javaweb之request乱码解决(数据提交以post方式和get方式)
- JAVA中Get、Post方式提交中文乱码解决方法
- ajax post方式表单提交setRequestHeader报错解决方法
- Spring MVC 3 表单中文提交post请求和get请求乱码问题的解决方法
- HttpClient4.5.2版本中POST提交中文参数时乱码问题解决方法
- JQuery中Ajax的Post提交在IE下中文乱码的解决方法
- springMvc 完美解决 multipart/form-data 方式提交请求 在 Filter 中 ServletRequest.getParameter方法 获取不到参数的问题
- 解决用jquery的get或者post提交方式提交到struts2中的action中文乱码问题
- springmvc post方式提交form时乱码问题——filter方式解决
- jsp表单提交的两种方式对应的乱码解决方法
- js超链接使用post方式提交----解决中文乱码
- tomcat里面表单以get方式提交出现中文乱码解决方法
- 解决中文乱码的filter(包括get和post提交两种方式)
- jsp中get(URI)方式提交表单的中文乱码解决方法
- JSP 表单输入,UTF编码,get方式提交数据出现中文乱码解决方法
- asp整合到asp.net当中,当asp中form提交后,request中文名为乱码的解决方法
- HTML使用post方式提交中文内容出现乱码的错误解决方式
- [前端]解决form表单采用get方式提交中文参数乱码的方法
- 用Filter解决GET和POST提交的中文乱码方法