Source code, a.jsp to b.jsp value:
a.jsp Page Content:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<form action="b.jsp">
name:<input type=text name=name>
<input type=submit>
</form>
b.jsp Page Content:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%
String name=request.getParameter("name");
%>
<body>
<%=name%>
</body>
Phenomenon: Chinese garbled, such as "?????? ”
The workaround is as follows:
Method One:
1. In b.jsp, replace pageencoding= "GB2312" with pageencoding= "Iso8859-1"
Although this b.jsp page display content or garbled, but not the kind of "?????? "The garbled, but some special characters
2. Then in the browser to see the menu modified into GB2312 code, then garbled display in Chinese.
3. However, this method is not feasible.
Method Two:
1. In the b.jsp string name=request.getparameter ("name");
String Name=new string (Request.getparameter ("name"). GetBytes ("Iso-8859-1"), "GB2312");
2. Then the display on the page, it is Chinese.