1.在struts.config.xml文件里 添加插件
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="classpath:applicationContext.xml" />
</plug-in>
2.在web.xml里添加监听器
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
本文介绍了如何在Struts框架中整合Spring框架。主要通过在struts.config.xml中添加Spring插件配置,并在web.xml中设置Spring监听器来实现。这有助于更好地管理业务逻辑和依赖注入。

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



