本帖最后由 zhiwen2080 于 2010-08-17 13:26:21 编辑

解决方案 »

  1.   

    var responseData = Ext.decode(response.responseText);
      

  2.   

    在前台取action的值,首先你需要用PrintWrite 将值输出。。而且这个action是不能有返回值了的。
    你是需要通过respose返回到前台去的。在resposne已经响应完了。。不能再有return的,在前台的回调函数里面 你就可以使用  
       var data = Ext.util.decode(response.responseText); action里面的方法应该改一下。、、 public void  getListInfo()  //返回void类型
    {
      DBUtils db=new DBUtils();
       Result res=new Result();
        res.setPerList(db.getList());
         JSONArray josn=JSONArray.fromObject(res);
          result=josn.toString().substring(1,(josn.toString().length()-1));
         // return SUCCESS;  //不需要在return 直接
       HttpResponse response =  SevletActionContext.getResponse();
           response.getWrite().print(result);    //这样子输出到前台,不然你就算去前台取值也取值不到。
               
       response.getWrite().print(true);}  //如果是要有页面跳转,应该是另外再用个一个action请求跳转的。
      public String forward(){
        return "success";
      }  
    }
    //Extjs页面 就可以取值了。。
    Ext.Ajax.request({
    url:url,
    method:method,
    params:{name:param},
    success:function (response,options)
    {
    //这里想取得那个返回过来的值怎么取?
      alert(response.responseText);   //这样子取到的就是你的Json格式的数据
       var data = new Ext.util.JSON.decode(response.responseText); 
    },
    failure:function (response,options){alert("failure");}
    });
      

  3.   

    用struts2 结合一下jsonplugin.jar 插件struts支持 
      

  4.   

    可以考虑使用DWR框架的,这样的话,你在前端可以像在后台一样使用java代码获得数据~
      

  5.   

    把results转成JSONObject 类型  然后out.write(jsonobject.toString());输出到客户端 客户端在解释 显示。