其中name属性为汉字情况下用encodeURI两次对其进行编码,然后在后台URLDecoder.decode进行解码 --编码var row=btn.parentElement.parentNode;var name=document.getElementById("name"+(row.rowIndex-1)).value;var pwd=docum
--编码 var row=btn.parentElement.parentNode; var name=document.getElementById("name"+(row.rowIndex-1)).value; var pwd=document.getElementById("pwd"+(row.rowIndex-1)).value; var sno=document.getElementById("sno"+(row.rowIndex-1)).value; tbody1.rows[row.rowIndex-1].cells[0].innerHTML=name; tbody1.rows[row.rowIndex-1].cells[1].innerHTML=pwd; tbody1.rows[row.rowIndex-1].cells[2].innerHTML=sno; tbody1.rows[row.rowIndex-1].cells[3].innerHTML="" window.location.href="/system1.0/AlterStuUser?id="+id+"&username="+encodeURI(encodeURI(name))+"&password="+pwd+"&sno="+sno+""; --解码 request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String username=URLDecoder.decode(request.getParameter("username"), "utf-8");