Flex JAVA Map BlazeDS 参数的传递

来源:互联网 发布:西部数码域名转移管理 编辑:程序博客网 时间:2024/05/01 21:44

 

1、java 返回Map
   
   public Map findFilesByFolderid(String folderid, PageInfo pageInfo) {
    Map map = new HashMap();
    String queryString = "from TFile t where t.folderid = ?";
    Object[] parameters = new Object[] {folderid};
    List fileList = this.findPageByQuery(queryString, parameters, pageInfo);
    map.put("pageInfo", pageInfo);
    map.put("fileList", fileList);
    return map;
   }
   
   flex解析
   fileArr = event.result["fileList"] as ArrayCollection;
   pageInfo = event.result["pageInfo"] as PageInfo;
   
   2、Flex构造Map调用Java
   java
   @RemotingInclude
   public Map testMap(Map map2) {
    Map map = new HashMap();
    map.put("string", "fuck you");
    
    List list = new ArrayList();
    list.add("1");
    list.add("2");
    map.put("list", list);
    return map;
   }
   
   flex构造Map
   public function moveFile_clickHandler(event:MouseEvent):void
   {
    var map:Object = new Object();
    map["A"] = "aaa";
    map["B"] = "bbb";
    testmap.token = fileWSImpl.testMap(map);
   }
0 0