??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-紫蝶∏飛揚↗-文章分类-Jsonhttp://www.268147.live/algz/category/38532.htmlPurple Butterfly Flying QQ?7101519 Flex,Ext,Spring,Hibernate,EOS,SpringSecurity,Struts http://algz.googlecode.com/svn/trunk/zh-cnFri, 24 Feb 2012 01:57:00 GMTFri, 24 Feb 2012 01:57:00 GMT60[转] JSON-lib框架Q{换JSON、XML不再困难http://www.268147.live/algz/articles/370571.html紫蝶∏飛揚↗紫蝶∏飛揚↗Thu, 23 Feb 2012 02:56:00 GMThttp://www.268147.live/algz/articles/370571.htmlhttp://www.268147.live/algz/comments/370571.htmlhttp://www.268147.live/algz/articles/370571.html#Feedback0http://www.268147.live/algz/comments/commentRss/370571.htmlhttp://www.268147.live/algz/services/trackbacks/370571.html阅读全文

紫蝶∏飛揚↗ 2012-02-23 10:56 发表评论
]]>
EXTJS 中接收到?JSON 字符串{换成 JS 数组对象,具体可以跟踪查询http://www.268147.live/algz/articles/228107.html紫蝶∏飛揚↗紫蝶∏飛揚↗Wed, 10 Sep 2008 03:53:00 GMThttp://www.268147.live/algz/articles/228107.htmlhttp://www.268147.live/algz/comments/228107.htmlhttp://www.268147.live/algz/articles/228107.html#Feedback0http://www.268147.live/algz/comments/commentRss/228107.htmlhttp://www.268147.live/algz/services/trackbacks/228107.html load : ( Object This, Object node, Object response )
Fires when the node has been successfuly loaded.

JS:

//[{"identity":"","title":"车n部门","date":"","uiProvider":"col","author":"","children":[{"identity":"车n部门"......
treeload.on('load', function(This, node, response) {                                 //事g的参数可查API, 参数的属性可以用 firebug 跟踪查询.
    var t = Ext.util.JSON.decode(response.responseText);
    var n;
    if (t[0].children.length == 0)           //? length不是JSON对象,仅仅是JS对象内置数组属?JS对象调用: t[0].children
        n = n + 1;

紫蝶∏飛揚↗ 2008-09-10 11:53 发表评论
]]>
JSF/JSP ?EXTJS 之间 JSON 互传数据(json-lib ?org.json 解析工具)http://www.268147.live/algz/articles/203548.html紫蝶∏飛揚↗紫蝶∏飛揚↗Wed, 28 May 2008 08:16:00 GMThttp://www.268147.live/algz/articles/203548.htmlhttp://www.268147.live/algz/comments/203548.htmlhttp://www.268147.live/algz/articles/203548.html#Feedback4http://www.268147.live/algz/comments/commentRss/203548.htmlhttp://www.268147.live/algz/services/trackbacks/203548.html一.org.json 解析?(推荐使用,更适合于对象模?
概述及例? http://code.google.com/p/json-simple/
API: http://code.google.com/p/json-simple/
?试通过,注意延迟加蝲问题):
  JSONArray  jsona=new JSONArray();
  JSONObject jsono=new JSONObject();
  List<Author> l=authorDAO.findAll();
  for(Author a:l){
   jsono.put("author_num", a.getAuthorNam());
   jsono.put("author_nam", a.getAuthorNum());
   jsono.put("author_sex", a.getAuthorSex());
   jsono.put("author_level", a.getLevel().getLevelNam());
   jsono.put("author_department", a.getAuthorDepartment());
   jsona.add(jsono.clone());              //jsono.clone()q回实例对象;jsono仅仅只是个指?br />    jsono.clear();                                //必须清除内容以备下次调用.
  }

?json-lib 解析?br /> (1)所需依赖的类文g

Json-lib requires (at least) the following dependencies in your classpath:

  • jakarta commons-lang 2.3               //appach|站下蝲最新的
  • jakarta commons-beanutils 1.7.0     //appach|站下蝲最新的
  • jakarta commons-collections 3.2     //appach|站下蝲最新的
  • jakarta commons-logging 1.1          //appach|站下蝲最新的
  • ezmorph 1.0.4

详见: http://json-lib.sourceforge.net/

(2)下蝲JSON-LIB-2.2.1,q查?ezmorph 1.0.4 文g

https://sourceforge.net/project/showfiles.php?group_id=171425

(3)举例:

 

 1import net.sf.json.JSONArray;
 2
 3
 4
 5boolean[] boolArray = new boolean[]{true,false,true};      
 6           JSONArray jsonArray1 = JSONArray.fromObject( boolArray );      
 7           System.out.println( jsonArray1 );      
 8           // prints [true,false,true]     
 9              
10           List list = new ArrayList();      
11           list.add( "first" );      
12           list.add( "second" );      
13           JSONArray jsonArray2 = JSONArray.fromObject( list );      
14           System.out.println( jsonArray2 );      
15           // prints ["first","second"]     
16  
17           JSONArray jsonArray3 = JSONArray.fromObject( "['json','is','easy']" );      
18           System.out.println( jsonArray3 );      
19           // prints ["json","is","easy"]  



紫蝶∏飛揚↗ 2008-05-28 16:16 发表评论
]]>
3 ɹʮһѡͼ ɽ11ѡ5׿ Фڲ Ӣֲվ ƱѶ רԤ ʮһѡ弼 28ַ Ͽ© ڷɵӿ