location.href 传参乱码解决方法

第一种:
先通过JSencodeURI方法将url进行转码
location.href = https://www.it610.com/article/encodeURI("findTransportordersByPrincipalUserIdNotNullVehicleInfoAction?keyword="+keyword);

java 解码
String keyword = new String(request.getParameter("keyword").getBytes("ISO8859-1"), "UTF-8");


第二种:
先通过encodeURIComponent 的两次转码
location.href = "https://www.it610.com/article/findTransportordersByPrincipalUserIdNotNullVehicleInfoAction?keyword="+encodeURIComponent(encodeURIComponent(keyword));

java解码
String keyword=URLDecoder.decode(request.getParameter("keyword"),"UTF-8");


两种方法亲测有效
【location.href 传参乱码解决方法】

    推荐阅读