The NoteBook of EricKong

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

          spring的 配置文件在啟動(dòng)時(shí),加載的是web-info目錄下的applicationContext.xml,
          運(yùn)行時(shí)使用的是web-info/classes目錄下的applicationContext.xml。

          配置web.xml使這2個(gè)路徑一致:

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

          多個(gè)配置文件的加載
          <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 閱讀(254) 評(píng)論(1)  編輯  收藏 所屬分類: Spring

          Feedback

          # re: 在web.xml中通過(guò)contextConfigLocation配置spring 2014-08-15 15:39 Eric_jiang
          http://blog.csdn.net/shan9liang/article/details/9117233  回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 镇江市| 杭锦旗| 荣成市| 德安县| 合江县| 兴安盟| 济源市| 江永县| 沙田区| 集贤县| 广德县| 武穴市| 平南县| 定南县| 怀宁县| 交口县| 扎赉特旗| 张掖市| 简阳市| 鹰潭市| 蒙城县| 沽源县| 陇西县| 许昌县| 青阳县| 林芝县| 汝南县| 乌什县| 萍乡市| 六盘水市| 长葛市| 嵩明县| 海原县| 拜泉县| 中方县| 仁怀市| 安多县| 泾川县| 马龙县| 祥云县| 石阡县|