close
以下內容設定在 web.xml
--------------------------------------------------------------------------------
<!-- 不設定起始參數 (三擇一) -->
<!-- 將Spring 設定檔 命名為applicationContext.xml 並放在 WEB-INF 目錄下 -->
--------------------------------------------------------------------------------
<!-- 設定起始參數 告知Spring 設定檔位置(xml檔) -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springConfig.xml</param-value>
</context-param>
----------------------------------------------------------------------------------
<!-- 設定起始參數 告知Spring 設定檔位置(java檔) -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>model.spring.SpringJavaConfiguration</param-value>
</context-param>
<!-- 設定起始參數 告知Spring 設定檔為java檔 -->
<context-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</context-param>
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
<!-- 綁定listener (可用精靈設定) -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
--------------------------------------------------------------------------------------------------
全站熱搜