前端传参数到后台乱码

js:var reservename=encodeURIComponent(JSON.stringify(result),"utf-8");//这里将对象转换为json格式然后在用encodeURIComponent来设置编码
后台java:String reservename = request.getParameter("reservename");studentRuselt=URLDecoder.decode(reservename,"UTF-8");

你可能感兴趣的:(前端传参数到后台乱码)