在web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
在config.xml
<action-mappings>
<action path="/login" type="org.springframework.web.struts.DelegatingActionProxy" scope="request"></action>
</action-mappings>
<message-resources parameter="com.neusoft.struts.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="classpath:applicationContext.xml" />
</plug-in>
在application.xml
<bean name="/login" class="com.neusoft.struts.LoginAction"></bean>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
在config.xml
<action-mappings>
<action path="/login" type="org.springframework.web.struts.DelegatingActionProxy" scope="request"></action>
</action-mappings>
<message-resources parameter="com.neusoft.struts.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="classpath:applicationContext.xml" />
</plug-in>
在application.xml
<bean name="/login" class="com.neusoft.struts.LoginAction"></bean>
本文详细介绍了如何在Web应用中使用Spring框架与Struts框架进行集成与配置,通过配置文件如web.xml, config.xml, 和 application.xml,实现了基于Spring的依赖注入和基于Struts的MVC架构。
201

被折叠的 条评论
为什么被折叠?



