前台:
function submitFCM()
{
var realName = $("input[name=realName]").val();//真实姓名 中文
var idcard = $("input[name=idcard]").val();
var params = {};
params['realName'] = realName;//真实姓名 中文
params['idcard'] = idcard;
//param.realName = realName;
//params.idcard= idcard;
$.getJSON(appPath_+"/ajax/bgy.xhtml",params, function(data)
{
var msg=eval("("+data+")");
if($.trim(msg.flag) == "ok")
{
alert("成功!");
window.location.href = appPath_+"/person/bgy.xhtml";
}
else
{
alert("失败!");
}
});
}
后台:
try
{
realName = new String(request.getParameter("realName").getBytes("ISO-8859-1"),"UTF-8");
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}