您的位置:首页 > 其它

win7/ubuntu9.10/双系统/GRUB2,覆盖9.10,全新硬盘安装10.04过程!

2010-12-24 21:55 330 查看
前台部分

 

首先定义一个数组,用来储存STORE里的值。

之后利用store自带的each遍历方法把数组填满。

最后建一个ajax请求传送到后台即可。

var lstAddRecord=new Array();

store.each(function(record) {

      lstAddRecord.push(record.data);

});

Ext.Ajax.request({

    url: 'function/rivaldata/rivalDataAction.do?tag=add',

    params: {strJson:Ext.encode(lstAddRecord)}

});

 

 

后台解析部分

 

主要是利用了JSON-Lib包,实现了关键功能。

  String strJson=request.getParameter("strJson");
  JSONArray js=JSONArray.fromObject(strJson);
  JSONObject jo=null;
  Iterator it=js.iterator();
  while(it.hasNext()){
       jo=(JSONObject)it.next();
       //follow codes are get the value :)
       String goodId=jo.getString("goodId");
       Double goodsPrice=jo.getDouble("goodsPrice");
       //ok, to do something use the vaules:)
       System.out.println("the goodId is :"+goodId);
  }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: