11 2010 档案

json中文乱码
摘要:前台无论是请求Servlet还是Action登出json取出数据在页面上显示为乱码需在后台程序中设置响应信息的字符集 JSONArray jsonArray=JSONArray.fromObject(userList); HttpServletResponse response=(HttpServletResponse) ActionContext.getContext().get(ServletActionContext.HTTP_RESPONSE); //必须加上,防止前端从JSON中取出的数据成乱码 response.setCharacterEncoding("UTF-8"); 阅读全文

posted @ 2010-11-29 18:31 archie2010 阅读(6499) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示