问题出现在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方法
浙公网安备 33010602011771号