java javascript jsp的url提交带中文参数时后台取到的是乱码问题的解决

xiaoxiao2026-08-21  9

jsp: document.forms[0].action = "updateUsers.do?editUTxt=" + encodeURI(editUTxt) ;//post提交 带有中文的变量用encodeURI包住 后台可以直接取,也可以解码后再取 String tempEditUTxt = request.getParameter("editUTxt");System.out.println(tempEditUTxt );try { System.out.println(java.net.URLDecoder.decode(tempEditUTxt ,"UTF-8"));} catch (UnsupportedEncodingException e) { e.printStackTrace();} 黑色头发:http://heisetoufa.iteye.com/
转载请注明原文地址: https://www.6miu.com/read-5051626.html

最新回复(0)