js中可以转码
action中也可以转码
参考资料。http://blog.csdn.net/yangbobo1992/article/details/8173387
javascript中 escape()
action认到的
response.setContentType("text/html;charset=UTF-8");
response.getWriter().println(msg);
在js中对提交的中文内容,用encodeURI进行两次编码 即encodeURI(encodeURI(中文内容)) 然后在 action里面用URLDecoder.decode(接收到的中文内容)解码就可以解决中文乱码问题了。