window.location.href汉语参数

window.location.href中文参数1.window.location.href url+&name + encodeURI(encodeURI(name)) nam

window.location.href中文参数

1.window.location.href = url+"&name=" + encodeURI(encodeURI(name)) ;
  name是中文,客户端编码两次,服务器端只需要解码一次
  name = java.net.URLDecoder.decode(name, "UTF-8");
2.window.location.href = url+"&name=" + encodeURI(name) ;
  name是中文,客户端编码一次,服务器端取值方法
  String  name=new String(request.getParameter("name").getBytes("ISO-8859-1"),"UTF-8");

3.<s:param name="name" alue="@java.net.URLEncoder@encode(name,'UTF-8')"/> 1 楼 happyprogram 2012-07-25   很不错,解决了我的乱码问题。谢谢