Spring容器的啟動(dòng)方法
一、在web.xml中配置Spring容器的啟動(dòng) (通用的方法)
二、struts1的啟動(dòng)方法
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
//如有多個(gè)spring配置文件用逗號(hào)隔開(kāi)
</context-param>
<!-- 通過(guò)Listener配置Spring容器隨Web應(yīng)用的啟動(dòng)而初始化 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
//如有多個(gè)spring配置文件用逗號(hào)隔開(kāi)
</context-param>
<!-- 通過(guò)Listener配置Spring容器隨Web應(yīng)用的啟動(dòng)而初始化 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
二、struts1的啟動(dòng)方法
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml,
/WEB-INF/action-servlet.xml" />
</plug-in>
<轉(zhuǎn)><set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml,
/WEB-INF/action-servlet.xml" />
</plug-in>
posted on 2007-10-11 15:50 月芽?jī)?/a> 閱讀(1170) 評(píng)論(0) 編輯 收藏 所屬分類: J2EE學(xué)習(xí)摘錄