struts整合spring中出现问题!!!

来源:百度知道 编辑:UC知道 时间:2024/06/27 18:10:48
问题现象如下:
1.struts能单独使用
2.spring也能单独使用
3.但是当struts和spring一起用时,问题出现了,在发布按提交按钮到一个action时,提示错误[Servlet action is not available]
4.在struts已配置action,通常是把action的control放在spring中,但是出现无法找到action.而后又在struts的action中加上type属性,错误依旧.

请帮忙解决下,是什么原因.
等待中,谢谢...

第一,我告诉你哦,一定要把最佳答案给我哦
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml"/>
</plug-in>
首先在struts里加上上面那句,在 <message-resources后面+
第二
在你要整合的aciton里的type里改成 type="org.springframework.web.struts.DelegatingActionProxy">

第三
在spring里做如下配置
<bean name="/stuDirectorLog"
class="com.jack.stu.struts.action.StuDirectorLogAction">
<property name="directorBo">
<ref bean="directorBo"/>
</property>
</bean>