冷面閻羅

          低調做人&&高調做事
          隨筆 - 208, 文章 - 3, 評論 - 593, 引用 - 0
          數據加載中……

          spring學習(二)

                  今天繼續學習spring,按照《Spring 開發指南》go on,結果到22頁的時候發現有如下代碼
          InputStream is = new FileInputStream("bean.xml");
          XmlBeanFactory factory 
          = new XmlBeanFactory(is);
          Action action 
          = (Action) factory.getBean("TheAction");
                使用junit4測試發送,發現有錯誤,但是依舊可以運行得到預期的結果。

                查看API以及去網上baidu了一圈,發現底層的確沒有xmlbeanfactory(inputstream )的方法,但是不知道為什么夏老師依舊這樣寫?
                我根據API中方法,這樣實現
                  Resource in = new FileSystemResource("bean1.xml");
                  XmlBeanFactory factory 
          = new XmlBeanFactory((Resource) in);
                  Action action 
          = (Action) factory.getBean("TheAction");
                  System.out.println(action.execte(
          "xixi hha "));
               
                不知道,這個算不算是《Spring 開發指南》中的又一BUG
                等那天有時間 在單位找找牛人問問。

                不知道你發現這個問題么?說說你是怎么理解的,大家一起交流一下么?

          posted on 2008-09-26 22:41 冷面閻羅 閱讀(492) 評論(0)  編輯  收藏 所屬分類: java

          主站蜘蛛池模板: 南开区| 晋宁县| 宁明县| 嵊州市| 仙桃市| 大关县| 赤峰市| 长治市| 青河县| 聂拉木县| 古蔺县| 苏州市| 龙岩市| 永清县| 镇原县| 蒙阴县| 阿拉善盟| 西乌| 武穴市| 彭水| 鹿邑县| 牟定县| 集贤县| 绥德县| 娄烦县| 阿鲁科尔沁旗| 铜川市| 花莲县| 集贤县| 太和县| 沅江市| 禹城市| 湖南省| 体育| 南皮县| 镇雄县| 东兰县| 云安县| 仙游县| 南乐县| 秦皇岛市|