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 閱讀(254) 評論(1)  編輯  收藏 所屬分類: Spring

          Feedback

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

          主站蜘蛛池模板: 安顺市| 鄱阳县| 武宣县| 方山县| 大庆市| 苗栗市| 斗六市| 万州区| 古蔺县| 贡山| 辽阳市| 德庆县| 潼南县| 新平| 正定县| 金寨县| 将乐县| 沈阳市| 当涂县| 吴江市| 泌阳县| 全州县| 开封县| 金湖县| 永济市| 忻州市| 嘉黎县| 昌平区| 色达县| 枣庄市| 新宾| 鄱阳县| 景谷| 鱼台县| 板桥市| 平江县| 台南县| 原平市| 阿拉善左旗| 金乡县| 深水埗区|