日期:2014-05-16 浏览次数:20339 次
<package name="strutsjson" extends="json-default"> <action name="mainAction" class="com.xxx.beans.web.xxxx" > <result type="json"/> </action> </package>
public String main(){ List l = XXXXX; str = JSONArray. fromObject(l).toString(); this.setStr(str); return SUCCESS; }
$(document).ready(function(){ $.getJSON("mainAction!main", function(data){ $.each(eval(data.str),function(entryIndex,item){ html+= item['sorts']; html+= item['postscount']; $('#list').append(html); }); }); });