request.setCharacterEncoding("utf-8");
不加这句话时,从input控件得到值要用new String(request.getParameter("").getBytes("ISO-8859-1"),"utf-8")方法,
而从 a href=""中得到值直接用request.getParameter("")方法;
而加入了这句话后,从input控件得到值直接用request.getParameter("")方法,而从 a href=""中得到值也要用request.getParameter("")方法
转载于:https://www.cnblogs.com/strive-for-freedom/p/4057618.html
本文讨论了字符编码设置对HTTP请求中不同来源参数获取方式的影响,具体包括从输入框和链接中获取参数的变化。
548

被折叠的 条评论
为什么被折叠?



