在项目中出现了,通多js向后台传中文参数乱码的,在web.xml文件里添加了过滤器依旧没其效果,
因为用的是get请求。过滤器并未拦截到,可使用
var str = encodeURI(encodeURI(“中文信息”));
/demo.action?title=str;
在后台接收时使用
java.net.URLDecoder.decode(request.getParameter("title"), "UTF-8");
?
原文:http://yafei-bian.iteye.com/blog/2292065