老问题,jsp页面中文显示 <%@ page contentType="text/html; charset=GB2312" %> //try 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1、<%@ page contentType="text/html; charset=GB2312" %> 试过,不行 request.setCharacterEncoding("gb2312")呢? String errorMsg = new String((request.getParameter("errorMsg")).getBytes("8859_1")); 试试errorMsg = new String(errorMsg.getBytes("ISO8859-1")); 再次尝试,还是不行!发现一个问题直接在地址栏中键入“http://localhost/test.jsp?errorMsg=中文”,页面显示正常而通过servlet传来的url是这样的http://localhost/test.jsp?errorMsg=瀵嗙各位帮忙阿!! jsp:<%@ page contentType="text/html; charset=GBK" %>servlet:response.setContentType("text/html; charset=GBK");request.setCharacterEncoding("GBK"); response.sendRedirect( nextURL + "?" + errorMsg=java.net.URLEncoder.encode("中文")); String errorMsg = java.net.URLDecoder.decode(request.getParameter("errorMsg")); <%@page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%> String errorMsg = java.net.URLDecoder.decode(request.getParameter("errorMsg"));看来又给解决乱码问题提供了一个新思路good idea!!问题已经解决,谢谢大家帮忙!! response.setStatus()的疑问? my eclipse 8.5中必须在WebRoot里建立JSP页面吗?小弟初学JSP,在线等候大虾们! weblogic + axis + 参数 :报错 struts1 多个文件下载问题 jfreechat 曲线图 无值不显示 jsp页面与UI层java类的交互问题 在JSP中,如何禁用IE的 “前进”、“后退”功能? 数据源的问题,急急 关于ORACLA字符转换问题 调用什么函数可以知道来访者的IP地址,小弟先谢谢了???? 如何得到将当前时间加n天後的时间 在JAVABEAN中如何得到上下文参数?我没有用到servlet,高分相送
发现一个问题
直接在地址栏中键入“http://localhost/test.jsp?errorMsg=中文”,页面显示正常
而通过servlet传来的url是这样的http://localhost/test.jsp?errorMsg=瀵嗙各位帮忙阿!!
<%@ page contentType="text/html; charset=GBK" %>
servlet:
response.setContentType("text/html; charset=GBK");
request.setCharacterEncoding("GBK");
pageEncoding="gb2312"%>
看来又给解决乱码问题提供了一个新思路
good idea!!问题已经解决,谢谢大家帮忙!!