页面通过拼接传参会出现乱码问题,这里做个备忘
前台用encodeURI()方法解析中文字符,再用encodeURI()解析URL 后台需要用URLDecoder.decode(name, "UTF-8");解析
window.location.href=encodeURI('local?'+'tradeBeginDate='+beginTime+'&&'+'tradeEndDate='+ endTime +'&&'+'fundCode='+fundCode+'&&'+'name='+encodeURI(name)+'&&'+'tradeAccountId='+tradeAccountId);
String name=request.getParameter("name");
name = URLDecoder.decode(name, "UTF-8");