解决: js向后台传参数出现乱码

前台js代码块中对各个变量进行编码处理如下:
var typeselect = form2.typeselect.value;
//var typeselect = document.getElementById('typeselect').value;
//怎么获得值得自己用自己的方式, 不一定要像我酱紫..


typeselect=encodeURI(typeselect);
typeselect=encodeURI(typeselect);
form2.action="xxxx.do?typeselect="+typeselect;
form2.submit();

在后台进行获取:
import java.net.URLDecoder;

if (request.getParameter("typeselect") != null) {
    typeid = request.getParameter("typeselect");
    typeid = URLDecoder.decode(typeid, "utf-8");
}

经测试, 乱码问题得以解决;

你可能感兴趣的:(.net,PHP,servlet,asp.net,asp)