1.导入spring的核心包:spring.jar
二者集成开发所需的包:struts-spring-plugin-2.0.6.jar
2.修改web.xml配置文件
配置spring加载上下文时的监听器
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
3.先改一下 src/struts.properties 文件,增加:
struts.objectFactory = spring
或者在struts.xml中常量配置
4.spring配置文件改为:
<beans default-autowire="autodetect">
struts2整合spring步骤
最新推荐文章于 2025-08-14 09:32:24 发布