This article mainly introduced the JSP in the page to pass the Chinese character parameter transcoding method, has the need friend may refer to the
Transfer code: a.href= "./showcont.jsp?tcontent=" +encodeuri (encodeURI (tcontent)); Decoding: Java.net.URLDecoder.decode ((String) request.getparameter ("Tcontent"), "UTF-8"); Example a.jsp source code code is as follows: <%@ page contenttype= "text/html; charset=gb2312 "language=" java "import=" java.sql.* "errorpage=" "%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/> <title> Untitled document </title> </head> <body> <% string str_test = "Chinese laborers"; %> <form method=post action= "b.jsp?test=<% =java.net.urlencoder.encode (str_test)%> "> <input type=" Submit "value = "Submit" Name= "Submission" > </form> </body> ;/html> b.jsp source code Copy code code as follows: <%@ page contenttype= "text/html; charset=gb2312 "language=" java "import=" java.sql.* "errorpage=" "%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/> <title> Untitled document </title> </head> <body> <% string str = new String (Request.getparameter ("test"). GetBytes ("Iso8859_1")); %& gt; <BR> <%=str%> </body> </html>