1.加入相关的包
commons-logging-1.1.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.6.jar
xwork-2.0.1.jar
2.配置struts.properties文件:
struts.configuration.xml.reload=true
struts.objectFactory=spring
struts.objectFactory.spring.autoWire=name
struts.custom.i18n.resources=fses
struts.configuration.xml.reload=true
3.配置struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.objectFactory" value="spring"/>
<include file="struts-stuAction.xml"/>
<package name="user" extends="struts-default" namespace="/">
</package>
</struts>
本文介绍如何在Struts2框架中整合Spring框架,包括所需JAR包、struts.properties及struts.xml配置文件的具体设置。
655

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



