[错误为:
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [updatePAction]
java.lang.ClassNotFoundException: updatePAction
配置为:
struts.xml<action name="updatePStudent" class="updatePAction">
<result >updateStudentAction.action</result>
</action>
<action name="updateStudentAction" class="updateStudentAction">
<result type="redirect">/listStudent.action</result>
<result name="input">/update.jsp</result>
</action>  list.jsp  <s:iterator value="#request.list" id="us" >
  <tr>
  <td><s:property value="#us.id"/></td>
 <td><s:property value="#us.name"/></td>
 <td><s:property value="#us.password"/></td>
<td><s:property value="#us.age"/></td>
  <td><s:a href="deleteStudent.action?student.id=%{#us.id}" onclick="return dell();" >delete</s:a></td>
  <td><s:a href="updatePStudent.action?student.id=%{#us.id}">update</s:a></td>
  </tr>
  </s:iterator>
applicationContext.xml<bean id="updatePAction" class="action.updatePStudentAction" scope="prototype">
<property name="studentService" ref="studentService"/>
</bean>
<bean id="updateStudentAction" class="action.updateStudentAction" scope="prototype">
<property name="studentService" ref="studentService"/>
</bean>

解决方案 »

  1.   

    <bean id="updatePAction" class="action.updatePStudentAction" scope="prototype">
    <property name="studentService" ref="studentService"/>
    </bean>看看里面的class 的路径写对了没
      

  2.   

    <bean id="updatePAction" class="action.updatePStudentAction" scope="prototype">
    <property name="studentService" ref="studentService"/>
    </bean>
    <bean id="updateStudentAction" class="action.updateStudentAction" scope="prototype">
    <property name="studentService" ref="studentService"/>
    </bean>我认为 一个service应该对应一个action吧  你的两个action对应的是一个service
      

  3.   

    你在struts。xml 有没显式的写 让spring去管理struts的action?
      

  4.   

    恩 问题解决了 是设计时逻辑出错了 在struts中 <action name="updateStudentAction" class="updateStudentAction"> class的值写成applicationContext 中bean 的ID值 是不是就算是告诉Action 有Spring 创建
      

  5.   

    首先要有集成的struts2 spring的jar包,然后要在struts的配置文件中说明下