处理js传参数有中文乱码的情况
js编码 :
var comment = document.all.comment.value;
comment = encodeURI(comment );
comment = encodeURI(comment );//注重要两次
action解码
String comment = request.getParameter("comment ");
try {
comment = java.net.URLDecoder.decode(comment, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}