url转码(url传中文乱码)
方法1
js
let keyword1 = $("#soft_input").val();
let keyword2=encodeURI(keyword1);
let keyword = encodeURI(keyword2).trim();
window.location = "${contextPath}/theme/themeSoft/"+type+".html?keyword="+keyword;
contorller
String keyword = request.getParameter(“keyword”);
keyword = java.net.URLDecoder.decode(keyword, “utf-8”);
方法2
nickname = new String(nickname.getBytes("ISO-8859-1"), "utf-8");