if (action.equals("ajax")) {
List<T_lottery_cshpojo> t_lotterycshList =T_lottery_cshdao.getT_lottery_csh();
JSONArray jsonArray2 = JSONArray.fromObject(t_lotterycshList);
response.getWriter().print(jsonArray2);
}
为什么返回的值中如果有中文,前台jquery ajax 就会执行下面的代码,解析中文有问题吗?求大神啊.急啊
error: function (XMLHttpRequest, textStatus, errorThrown)
{
alert(XMLHttpRequest.responseText);
} jqueryajaxxmlhttprequest
List<T_lottery_cshpojo> t_lotterycshList =T_lottery_cshdao.getT_lottery_csh();
JSONArray jsonArray2 = JSONArray.fromObject(t_lotterycshList);
response.getWriter().print(jsonArray2);
}
为什么返回的值中如果有中文,前台jquery ajax 就会执行下面的代码,解析中文有问题吗?求大神啊.急啊
error: function (XMLHttpRequest, textStatus, errorThrown)
{
alert(XMLHttpRequest.responseText);
} jqueryajaxxmlhttprequest
resp.setCharacterEncoding("UTF-8");