使用response.sendRedirect()时的中文问题
来源:互联网 发布:2017php找工作 编辑:程序博客网 时间:2024/04/27 20:44
问:
Resin服务器,中文显示时没有任何问题,但是当用response.sendRedirect()转到其它页面传过去的参数是中文时,参数值就会变成乱码,或者转向的文件名是中文时也无法显示,请高手指点该如何转换?
______________________________________________________________________________________________
答1:
对参数进行编码,如下:
传递时:
response.sendRedirect("next.jsp?value="+java.net.URLEncoder.encode("中文"));
接受时:
out.print(new String(request.getParameter("value")).getBytes("ISO8859_1"),"gb2312");
Resin服务器,中文显示时没有任何问题,但是当用response.sendRedirect()转到其它页面传过去的参数是中文时,参数值就会变成乱码,或者转向的文件名是中文时也无法显示,请高手指点该如何转换?
______________________________________________________________________________________________
答1:
对参数进行编码,如下:
传递时:
response.sendRedirect("next.jsp?value="+java.net.URLEncoder.encode("中文"));
接受时:
out.print(new String(request.getParameter("value")).getBytes("ISO8859_1"),"gb2312");
- 使用response.sendRedirect()时的中文问题
- 解决response.sendRedirect引出的中文问题
- JSP的response.sendRedirect()中文参数问题
- iframe和response.sendRedirect使用的问题
- iframe和response.sendRedirect使用的问题
- iframe和response.sendRedirect使用的问题
- iframe和response.sendRedirect使用的问题
- response.sendRedirect的使用
- response.sendRedirect的使用
- jsp中response.sendRedirect()的中文参数乱码问题
- 关于response.sendRedirect传递中文出现乱码问题的解决方案
- response.sendRedirect无法传递中文参数的问题
- response.sendRedirect(message);中文乱码问题
- 使用response.sendRedirect的注意事项。
- response.sendRedirect和html frame配合使用的问题
- response.sendRedirect和html frame配合使用的问题
- 有关jsp中的response.sendRedirect()的问题
- response.sendRedirect() 的session丢失问题
- 一个让人发狂的PI求解C程序
- 在VB中使用注册表
- 浅谈如何学习linux
- C编程练笔-质数
- 实现小数据量和海量数据的通用分页显示存储过程
- 使用response.sendRedirect()时的中文问题
- Windows编程中的映射模式和坐标转换
- 在Linux下安装JDK及环境设置
- 这两天MSN Space不能正常访问
- PUBwin ep免费上网又一招
- 在ListCtrl中进行排序
- 在Linux下安装设置JDK- -
- Eclipse 运行命令行参数大全
- [软件人生]小评国内的老板