The NoteBook of EricKong

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            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 參數定義了要裝入的 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  回復  更多評論
            

          主站蜘蛛池模板: 横峰县| 托里县| 广西| 上高县| 体育| 金昌市| 塘沽区| 南江县| 张家川| 安溪县| 临桂县| 晋州市| 佳木斯市| 重庆市| 富锦市| 苏尼特右旗| 车险| 林芝县| 铜川市| 聂拉木县| 芮城县| 久治县| 黄龙县| 芦山县| 什邡市| 安阳市| 枣阳市| 漳平市| 汾阳市| 济源市| 巴林右旗| 鞍山市| 兴安县| 乌拉特中旗| 左权县| 来凤县| 大港区| 泰兴市| 黄石市| 大关县| 东港市|