get提交中文后乱码的问题的解决

首先,encodeURIComponent对参数值 编码,要经过两次编码:
location.href = "productAction_searchInfoByType?searchSth=" + encodeURIComponent(encodeURIComponent(b));

java后台端一次解密

String searchSth = request.getParameter("searchSth");
java.net.URLDecoder.decode(searchSth, "UTF-8");

你可能感兴趣的:(get)