jQuery ajax获取strut2.0action 返回List>

// struts2.0配置文件
<action name="serviceTopAction" class="com.tydic.csb.web.servicetop.action.ServiceTopAction" method="queryComsumer">
<result name="success" type="json">
	<param name="root">traderList</param>
	</result>
</action>
// java 代码
public String queryComsumer(){
List<Map<Object,Object>> traderList =       serviceTopService.queryServiceTraderMap();	
     return SUCCESS;
}


    $.ajax({
	url : '<%=path%>/servicetop/serviceTopAction.do',//后台处理程序
	type : 'post',
	dataType : 'json',
	success : function(data){
	    $.each(data,function(key,value){
	    //console.info(data[key].TRADER_NAME);
             //console.log(value.CRT_DATE);
             $(value).each(function(){
	    console.log("/t" + value.CRT_DATE);
		});   
	   })
	},error : function(){}

你可能感兴趣的:(jQuery ajax)