1、JSP页面之间传递中文参数乱码
(1)、a.jsp中正常传递参数,b.jsp 中
<% String projectName = new String(request.getParameter("projectName").getBytes("ISO-8859-1"),"UTF-8"); %> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript"> var projectName="<%=projectName%>";//项目名称
2、前台后台
(1)、前台JSP中参数封装:ysmc = encodeURI(encodeURI(ysmc,"UTF-8"),"UTF-8");
后台参数解析:String name = URLDecoder.decode(entity.getYsmc(),"UTF-8");
(2)、action中接参数:nameString=new String(nameString.getBytes("ISO-8859-1"),"utf-8");