The NoteBook of EricKong

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks

          spring的 配置文件在啟動時,加載的是web-info目錄下的applicationContext.xml,
          運行時使用的是web-info/classes目錄下的applicationContext.xml。

          配置web.xml使這2個路徑一致:

          <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/classes/applicationContext.xml</param-value>
           </context-param>

          多個配置文件的加載
          <context-param>
                  <param-name>contextConfigLocation</param-name>
                  <param-value>
                      classpath*:conf/spring/applicationContext_core*.xml,
                      classpath*:conf/spring/applicationContext_dict*.xml,
                      classpath*:conf/spring/applicationContext_hibernate.xml,
                      classpath*:conf/spring/applicationContext_staff*.xml,
                      classpath*:conf/spring/applicationContext_security.xml
                      classpath*:conf/spring/applicationContext_modules*.xml
                      classpath*:conf/spring/applicationContext_cti*.xml
                      classpath*:conf/spring/applicationContext_apm*.xml
                  </param-value>
              </context-param>

          contextConfigLocation 參數(shù)定義了要裝入的 Spring 配置文件。

          posted on 2014-08-15 10:11 Eric_jiang 閱讀(251) 評論(1)  編輯  收藏 所屬分類: Spring

          Feedback

          # re: 在web.xml中通過contextConfigLocation配置spring 2014-08-15 15:39 Eric_jiang
          http://blog.csdn.net/shan9liang/article/details/9117233  回復  更多評論
            

          主站蜘蛛池模板: 九寨沟县| 饶阳县| 那坡县| 胶南市| 盱眙县| 永平县| 运城市| 景谷| 雅江县| 西藏| 封开县| 阳曲县| 长丰县| 嘉黎县| 盘锦市| 大田县| 龙南县| 通化市| 金溪县| 邳州市| 盘锦市| 东台市| 温宿县| 吕梁市| 平和县| 健康| 博乐市| 宜良县| 稻城县| 珲春市| 饶河县| 山西省| 盐津县| 张北县| 崇阳县| 墨脱县| 汉沽区| 辽源市| 宜城市| 仁怀市| 堆龙德庆县|