两jsp间传递中文参数乱码有关问题

两jsp间传递中文参数乱码问题a.jsp??? response.sendRedirect(error.jsp?errmsg+URLEncoder.encode(转

两jsp间传递中文参数乱码问题

a.jsp??? response.sendRedirect("error.jsp?errmsg="+URLEncoder.encode("转换结果为空!","UTF-8"));

b.jsp??? <%=new String(request.getParameter("errmsg").getBytes("ISO-8859-1"),"UTF-8")%>

如上写法可解决乱码问题