location.href传参数到后台中文乱码

首先在页面传参的地方要进行两次编码

location.href="/sigmaPage?articleId="+id+"&title="+encodeURI(encodeURI(title));
然后后台的action中还要进行一次解码

String str =  URLDecoder.decode(title, "UTF-8");

猜你喜欢

转载自blog.csdn.net/u010591939/article/details/47747855