首先,执行sendRedirect端,如下处理:
String url = "register.jsp?errormsg="+e.getMessage();
url = new String(url.getBytes("gb2312"),"ISO8859_1"); //由于参数都是ISO8859_1编码
response.sendRedirect(url);
显示端:
<% String errormsg=new String(request.getParameter("errormsg").getBytes("iso8859_1"),"gb2312"); out.println(errormsg); %>