本人测试成功。
//验证
function validateSupplier(){
var supplierName = document.getElementById("supplierName").value ;
supplierName = encodeURI(encodeURI(supplierName)) ;
if(supplierName != ''){
var url = "${ctx}/supplier_validateSupplier.do?supplierName=" + supplierName ;
jQuery.post(url, null, function(resp) {
if("not" == resp){
$("#uploadBtn").hide() ;
$("#submitBtn").hide() ;
$("#msgSpan").html("存在同名供应商!") ;
} else {
$("#uploadBtn").show() ;
$("#submitBtn").show() ;
$("#msgSpan").html("") ;
}
});
}
}
JS:encodeURI(encodeURI(string))
action or servlet : java.net.URLDecoder.decode(request.getParameter("keyWord"),"UTF-8")