-
将需要的jar包加到lib下
-
修改web.xml文件,增加一个listener,代码如下
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <!-- 默认找的位置是:/WEB-INF/applicationContext.xml --> <!-- <param-value>/WEN-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value> --> <param-value>classpath:beans.xml</param-value> </context-param>
-
通过上面的配置后,就可以在Spring容器中通过IoC来注入相关的Action
Spring整合Struts2
最新推荐文章于 2024-08-17 03:09:48 发布
本文介绍如何在Spring框架中配置IoC容器,包括添加必要的jar包、配置web.xml文件引入ContextLoaderListener监听器,并指定Spring配置文件位置。
953

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



