JAVA:
Struts2轻松实现JSON,所需包
相关代码:
List<Bs_Equip> equips=homePageDao.getEquipInfo();
JSONObject json=new JSONObject();
json.accumulate("equips", equips);
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.write(json.toString());/
out.flush();
out.close();
return NONE;
其中,涉及问题:
》关于json-lib There is a cycle in the hierarchy!问题的3种解决办法
参阅:http://blog.youkuaiyun.com/zhengbo0/article/details/8269148
Jsp页面解析JOSN:
》参阅 :http://www.cnblogs.com/xiaopin/archive/2010/08/12/1797884.html
JS,String Buffter 运用:
>>参阅:http://www.jb51.net/article/22828.htm
其他:http://www.cnblogs.com/myjavawork/archive/2011/03/10/1979279.html