搞了两天了没搞通,各位高手是否有例子给一个?//我的代码如下,不知道错在哪里,请指教//Action中生成JSON
public ActionForward ypurchplanquery_d(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) 
 {
try{
   ExtDataChange extDataChange = new  ExtDataChange();    String aparam = (String) request.getParameter("ypurchplanquery_d");
   List lst = ypurchplandao.GetYPurchPlanInfo(aparam);
// System.out.println(extDataChange.getJsonFromList(lst));
   String jsonstr = extDataChange.getJsonFromList(lst);
   response.setContentType("text/json; charset=GBK");
   response.getWriter().write(jsonstr);
//    System.out.println("输出到前台的JSON字符串是:" + jsonstr);
} catch (Exception e) {
e.printStackTrace();
request.setAttribute("error", "年采购计划查看失败");

return mapping.findForward("error");   
}
return mapping.findForward("ypurchplanquery_d");   
}//生成的结果输出到前台的JSON字符串是:{"items":[{"carStyle":"carstyle","guid":"9A9DC4D1-05B8-4B80-81B6-4E604164B1D3","m1":1,"m10":10,"m11":11,"m12":12,"m2":2,"m3":2,"m4":3,"m5":5,"m6":6,"m7":7,"m8":8,"m9":9,"planNo":"1","poNum":1,"productDesc":"ooo","productId":"001","productName":"02323","re":"125636","syear":2010},{"carStyle":"carstyle","guid":"492AA1C7-753B-40EB-8AE6-7DDED9775802","m1":1,"m10":10,"m11":11,"m12":12,"m2":2,"m3":2,"m4":3,"m5":5,"m6":6,"m7":7,"m8":8,"m9":9,"planNo":"1","poNum":1,"productDesc":"ooo","productId":"001","productName":"02323","re":"125636","syear":2010}],"results":2}
//在Ext的JS中是这样定义的
   var store = new Ext.data.Store({
        // destroy the store if the grid is destroyed
       // autoDestroy: true,
        
        // load remote data using HTTP
       // url: 'ypurchplan.do?action=ypurchplanquery_d',
//       proxy: new Ext.data.HttpProxy({   
//            method:"POST"
//        }),
        // specify a XmlReader (coincides with the XML format of the returned data)
        reader: new Ext.data.JsonReader({
            url: "ypurchplan.do?action=ypurchplanquery_d",
            root: 'items',
            totalProperty: 'results',
            autoload: true,
            // use an Array of field definition objects to implicitly create a Record constructor
            fields: [
                // the 'name' below matches the tag name to read, except 'availDate'
                // which is mapped to the tag 'availability'
                {name: 'poNum', type: 'string'},
                {name: 'carStyle', type: 'string'},
                {name: 'productID', type: 'string'},
                {name: 'productName', type: 'string'},             
                {name: 'productDes', type: 'string'},             
                {name: 'syear', type: 'int'},             
                {name: 'm1', type: 'int'},             
                {name: 'm2', type: 'int'},             
                {name: 'm3', type: 'int'},             
                {name: 'm4', type: 'int'},             
---------------------------
请高手指教?