對須要傳遞的中文參數先進行兩次轉碼: 1.js文件中使用encodeURI()方法。jsp
var url = "Validate.jsp?id=" + encodeURI(encodeURI(idField.value));url
2.在後臺中對傳遞的參數進行URLDecoder解碼code
String username = URLDecoder.decode(request.getParameter("id"),"UTF-8");get