A.jsp页面传送msg参数到B.jsp页面还不是乱码,
但是在B.jsp页面用URL重写跳转到到C.jsp页面的时候,就变成了乱码。
而且在后台打印url地址的时候msg的内容就是乱码了。
这种问题怎么办啊?相当的急啊。B.jsp代码如下
String strMsg = request.getParameter("msg");
strMsg = strMsg==null?"":strMsg.trim();
strMsg = new String(strMsg.getBytes("ISO-8859-1"),"GB2312");RequestDispatcher dispatcher= request.getRequestDispatcher("C.jsp?"content="+strMsg);
dispatcher.forward(request, response); C.jsp的页面如下
<%@ page contentType="text/html; charset=gb2312" %>String strContent = request.getParameter("content");
System.out.println("C.jsp:" + strContent);
但是在B.jsp页面用URL重写跳转到到C.jsp页面的时候,就变成了乱码。
而且在后台打印url地址的时候msg的内容就是乱码了。
这种问题怎么办啊?相当的急啊。B.jsp代码如下
String strMsg = request.getParameter("msg");
strMsg = strMsg==null?"":strMsg.trim();
strMsg = new String(strMsg.getBytes("ISO-8859-1"),"GB2312");RequestDispatcher dispatcher= request.getRequestDispatcher("C.jsp?"content="+strMsg);
dispatcher.forward(request, response); C.jsp的页面如下
<%@ page contentType="text/html; charset=gb2312" %>String strContent = request.getParameter("content");
System.out.println("C.jsp:" + strContent);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货