问题出现在Struts和Spring整合开发中,导致所有链接都是404

情况一

在Struts中配置action的spring代理时,sping配置文件中javaBean的配置使用了id 而不是name

<action path="/login" scope="request"
      type="org.springframework.web.struts.DelegatingActionProxy" >
      <forward name="success" path="/manager/login.jsp" ></forward>
</action>
<bean id="/login" class="com.wyq.action.LoginAction">
        <property name="loginService" ref="loginService"></property>
</bean>

应该为

<bean name="/login"  class="com.wyq.action.LoginAction">
        <property name="loginService" ref="loginService"></property>
</bean>

情况二

<bean id="loginAction" name="/login" class="com.wyq.action.LoginAction">
        <property name="loginService" ref="loginService"></property>
</bean>

对应的loginAction未配置loginService属性,或者未配置属性的get/set方法

posted on 2012-06-08 15:40  饭菜糖衣  阅读(143)  评论(0)    收藏  举报