posts - 41, comments - 15, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          java轉換json需導入的jar包說明

          Posted on 2012-08-15 14:04 yuhaibo736 閱讀(4685) 評論(2)  編輯  收藏
          commons-beanutils-1.8.0.jar不加這個包
          java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
          commons-collections.jar 不加這個包
          java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap
          commons-lang-2.4.jar不加這個包
          java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
          commons-logging-1.1.1.jar不加這個包
          java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
          ezmorph-1.0.4.jar不加這個包
          java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher
          json-lib-2.3-jdk15.jar不加這個包
          java.lang.NoClassDefFoundError: net/sf/json/JSONObject
          相應jar包可到網上下載!
          實例:
          import java.util.ArrayList;
          import java.util.List;

          import net.sf.json.JSONArray;

          public class JsonTest {

          /**
          * @param args
          */
          public static void main(String[] args) throws Exception{
          boolean[] boolArray = new boolean[]{true,false,true}; 
          JSONArray jsonArray = JSONArray.fromObject( boolArray ); 
          System.out.println( jsonArray );

          List list = new ArrayList(); 
          list.add( "first" ); 
          list.add( "second" ); 
          JSONArray jsonArray2 = JSONArray.fromObject( list ); 
          System.out.println( jsonArray2 );
          }
          }

          評論

          # re: java轉換json需導入的jar包說明   回復  更多評論   

          2013-05-09 09:28 by asdas
          asdasda

          # re: java轉換json需導入的jar包說明   回復  更多評論   

          2014-02-19 14:12 by kele
          謝謝

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 乐山市| 扎赉特旗| 霞浦县| 碌曲县| 通江县| 日土县| 莲花县| 顺义区| 庆安县| 郓城县| 巴楚县| 阿城市| 武平县| 江门市| 盐池县| 台南市| 江城| 台北市| 柞水县| 惠州市| 大渡口区| 三原县| 阳山县| 永定县| 葵青区| 宁化县| 天津市| 卢氏县| 晋中市| 麻栗坡县| 商水县| 新河县| 许昌县| 武邑县| 湘潭市| 屯门区| 保定市| 亳州市| 凤凰县| 紫阳县| 昭苏县|