由于项目是分模块做的,现在有个在线考试的功能在工程的exam文件中。即在webroot里面,
web-inf里的struts-config.xml配置如下<!-- 考生 -->
 <action name="studentForm" path="/exam/manage/student" scope="request" type="com.wgh.action.Student" validate="true">
  <forward name="studentLoginok" path="/exam/default.jsp" />
      <forward name="studentQuery" path="/exam/manage/student.jsp" />
      <forward name="studentAdd" path="/exam/student_ok.jsp" />
      <forward name="modifyQuery" path="/exam/student_Modify.jsp" />
      <forward name="studentModify" path="/exam/studentM_ok.jsp" />
      <forward name="studentDel" path="/exam/manage/student_ok.jsp?para=3" />
      <forward name="seekPwd1" path="/exam/seekPwd1.jsp"/>
      <forward name="seekPwd2" path="/exam/seekPwd2.jsp"/>
      <forward name="error" path="/exam/manage/error.jsp" />
    </action>现在当超连接到exam文件下的index.jsp就报Cannot retrieve mapping for action 错
index.jsp代码如下:<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<head>
<title>网络在线考试</title>
<link href="CSS/style.css" rel="stylesheet">
<script language="javascript">
function check(form){
if (form.name.value==""){
alert("请输入准考证号!");form.name.focus();return false;
}
if (form.pwd.value==""){
alert("请输入密码!");form.pwd.focus();return false;
}
}
</script>
</head>
<body>
<table width="778" height="266" border="0" align="center" cellpadding="0" cellspacing="0" background="Images/login_top.jpg">
  <tr>
    <td width="118" colspan="2">&nbsp;</td>
  </tr>
</table>
<table width="778" height="158"  border="0" align="center" cellpadding="0" cellspacing="0" background="Images/login_mid.jpg">
<html:form action="manage/student.do?action=login" method="post" focus="ID" onsubmit="return check(studentForm)">
          <tr>
            <td>
  
                    <table width="100%"  border="0" cellpadding="0" cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#D2E3E6">
                        <tr>
<td>&nbsp;</td>
<td></td>
<td></td>
</tr>
<tr>
                          <td width="35%" height="30">&nbsp;</td>
                      <td width="9%" height="30">准考证号:</td>
                      <td width="27%">
   <html:text property="ID" styleClass="logininput" size="25"/>                       </td>
                      <td width="29%">&nbsp;</td>
                    </tr>
                        <tr>
                          <td height="30">&nbsp;</td>
                      <td height="30">密&nbsp;&nbsp;&nbsp;&nbsp;码:</td>
                      <td><html:password property="pwd" styleClass="logininput" size="25"/></td>
                      <td>&nbsp;</td>
                    </tr>
                        <tr>
                          <td height="31">&nbsp;</td>
                      <td height="31" colspan="2" align="left"><html:submit styleClass="btn_grey" value="登录"/>
                        &nbsp;
<html:reset value="重置" styleClass="btn_grey"/>
                        <html:button property="button" styleClass="btn_grey" value="注册" onclick="window.location.href='register.jsp'"/>
                        &nbsp;
                       <html:button property="button" styleClass="btn_grey" value="找回密码" onclick="window.location.href='seekPwd.jsp'"/></td>
                      <td>&nbsp;</td>
                    </tr>
                        <tr>
                          <td height="40">&nbsp;</td>
                          <td height="31" colspan="2" align="right" valign="bottom"><html:link page="manage/login.jsp" styleClass="word_orange">老师登录入口</html:link></td>
                          <td>&nbsp;</td>
                        </tr>

                    </table> 
    </td>
  </tr>
  </html:form>
</table>
<table width="778" height="196" border="0" align="center" cellpadding="0" cellspacing="0" background="Images/login_top.gif">
  <tr>
    <td height="182" background="Images/login_bottom.jpg">&nbsp;</td>
  </tr>
</table>
</body>
</html>
急求!在线等

解决方案 »

  1.   

      <action name="studentForm" path="/exam/manage/student" scope="request" type="com.wgh.action.Student" validate="true">
          <forward name="studentLoginok" path="/exam/default.jsp" />
          <forward name="studentQuery" path="/exam/manage/student.jsp" />
          <forward name="studentAdd" path="/exam/student_ok.jsp" />
          <forward name="modifyQuery" path="/exam/student_Modify.jsp" />
          <forward name="studentModify" path="/exam/studentM_ok.jsp" />
          <forward name="studentDel" path="/exam/manage/student_ok.jsp?para=3" />
          <forward name="seekPwd1" path="/exam/seekPwd1.jsp"/>
          <forward name="seekPwd2" path="/exam/seekPwd2.jsp"/>
          <forward name="error" path="/exam/manage/error.jsp" />
        </action>这里我并没有看见你的配置中有index.jsp啊 肯定是回报错的
      

  2.   

    Action的配置和页面中的引用路径不一致。