struts2和spring整合时为什么总是找不到struts.xml里面的class

struts.xml文件<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwa... 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.i18n.encoding" value="GBK"/>
<constant name="struts.objectFactory.spring.autoWire" value="name" />
<constant name="struts.objectFactory" value="spring"/>

<package name="login" extends="struts-default">

<action name="*_inforAction" method="{1}" class="inforAction">
<result name="selectInfor">/ItemManagement/itemManagement.jsp</result>
<result name="addInfor">/ItemManagement/itemManagement.jsp</result>
<result name="updateInfor">/ItemManagement/updateItem.jsp</result>
<result name="update2Infor">/ItemManagement/itemManagement.jsp</result>
</action>

<action name="*_customerAction" method="{1}" class="custAction">
<result name="selectCustomer">/ItemManagement/inforManagement.jsp</result>
<result name="updateCustomer">/ItemManagement/updateInfor.jsp</result>
</action>

<action name="*_relationAction" method="{1}" class="relaAction">
<result name="selectRela">/ItemManagement/relationAll.jsp</result>
<result name="addPage">/ItemManagement/insertRelation.jsp</result>
</action>

</package>
</struts>

applicationContext.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="custAction" class="com.easy.action.CustAction">
<property name="custService" ref="customerService"></property>
</bean>

<bean id="inforAction" class="com.easy.action.InforAction">
<property name="inforManageService" ref="inforService"></property>
</bean>

<bean id="relaAction" class="com.easy.action.RelaAction">
<property name="relationService" ref="relationService"></property>
</bean>

</beans>

struts属性文件
struts.objectFactory=com.opensymphony.xwork2.ObjectFactory
展开
 我来答
匿名用户
2010-08-16
展开全部
在Struts.xml里面的constant定义改为,特别是第二条,和你之前的定义方式不一样了。
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
<constant name="struts.objectFactory.spring.autoWire" value="type" />
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
bd周述兵
2010-08-16 · TA获得超过350个赞
知道答主
回答量:135
采纳率:0%
帮助的人:0
展开全部
导入插件包 struts2-spring-plugin-2.1.8.jar
struts属性文件
struts.objectFactory=com.opensymphony.xwork2.ObjectFactory //这个不要写
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
狂热1985
2010-08-16 · TA获得超过782个赞
知道小有建树答主
回答量:517
采纳率:0%
帮助的人:324万
展开全部
struts.xml中action的路径没写全
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
liubingwwww
2010-08-16 · 超过20用户采纳过TA的回答
知道答主
回答量:49
采纳率:0%
帮助的人:55.9万
展开全部
struts.objectFactory=spring
struts.objectFactory.spring.autoWire=name
试试
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式