jsp的url传递中文参数乱码解决方案,linux测试可用

url="xxx.jsp?id="+java.net.URLEncoder.encode("中文", "UTF-8")

在这里,我们要用java.net.URLEncoder.encode("中文", "UTF-8")

接收时,我们用
String inf=request.getParameter("id");
inf= new String(inf.getBytes("iso-8859-1"),"UTF-8");

就OK了~

你可能感兴趣的:(java,linux,.net,jsp)