在使用pagehelper分页时候,返回到前台的数据出现中文乱码。
根据http://blog.csdn.net/evankaka/article/details/49452201这篇博文做的,但是我的mvc配置文件,和spring配置文件没有像这样去设置编码,报错
JSONObject jsonObj = new JSONObject();
if(temp!=null&&temp.size()>0){
Card card = (Card)temp.get(0);
jsonObj.accumulate("id", card.getId());
jsonObj.accumulate("card_code", card.getCard_code());
jsonObj.accumulate("card_name", card.getCard_name());
jsonObj.accumulate("card_seq", card.getCard_seq());
jsonObj.accumulate("card_value", card.getCard_value());
jsonObj.accumulate("tel_no", card.getTel_no());
out.print(jsonObj);
}
在后台打印出是中文,但是前台展示时候出现中文乱码???? 编码方式都是utf-8.。