用戶端:
function processResponseExtends(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
//重新填寫mobileUaExtendsDiv的內容
alert(xmlhttp.responseText);
$("mobileUaExtendsDiv").innerHTML=xmlhttp.responseText;
}
}
function showUa_extends(mobileTypeName){
//alert("@@@111:"+mobileBrandId);
alert("mobileTypeName:"+mobileTypeName);
createXMLHttp();
xmlhttp.onreadystatechange = processResponseExtends;
var url = "<%=basePath%>game/getUaData?operator=showUaExtends&mobileTypeName="+mobileTypeName;
alert("url:"+url);
url = encodeURI(url);
url = encodeURI(url);
alert("encodeURI url:"+url);
xmlhttp.open("POST",url,true);
xmlhttp.send(null);
}
服務端:
log.debug("111111111111111111 mobileTypeName:"+request.getParameter("mobileTypeName"));
String mobileTypeName = request.getParameter("mobileTypeName");
mobileTypeName = java.net.URLDecoder.decode(mobileTypeName,"UTF-8");
log.debug("222222222222222222 mobileTypeName:"+mobileTypeName);
這樣子就解決了傳遞中文參數的問題啦。