SSI框架配置文件路徑問題:
struts2的 1個+N個 路徑:src+src(可配置) 名稱: struts.xml + N
spring 的 1個 路徑: src 名稱: applicationContext.xml
ibatis 的 1個+N個 路徑: src+src(可配置) 名稱: SqlMapConfig.xml + N
部署到tomcat后,src目錄下的配置文件會和class文件一樣,自動copy到應用的 classes目錄下
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 配置文件。
本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/happyinggirl/archive/2008/03/13/2176285.aspx
posted on 2009-10-15 11:18
super_nini 閱讀(16859)
評論(0) 編輯 收藏