首先,encodeURIComponent对参数值 编码,要经过两次编码:
location.href = "productAction_searchInfoByType?searchSth=" + encodeURIComponent(encodeURIComponent(b));
java后台端一次解密
String searchSth = request.getParameter("searchSth");
java.net.URLDecoder.decode(searchSth, "UTF-8");