struts 中页面提交的时候报 缺少result input

来源:互联网 发布:淘宝客赚钱教程 编辑:程序博客网 时间:2024/06/06 02:38

可能很多人都会遇到这样的问题

个人总结1:提交的时候有非空验证

2:也面中存在两个名字相同的 name

以下是本人遇到的问题

 <form id="form1" name="form1" method="post" action="">
                <table width="90%" border="0" cellspacing="0" cellpadding="0" class="addform-item">
             
                  <thead>
                    <tr>
                     <td>项目</td>
                     <td>金额</td>
                     <td>费用说明</td>
                     <td>操作
                    <%--报销单的总价格 --%>
      <input type="hidden" id="totals" value="<s:property value="claimVoucherInfo.claimTotalaccount"/>" name="claimVoucherInfo.claimTotalaccount" />
      <%--报销单编号 --%>
      <input type="hidden" value="<s:property value="claimVoucherInfo.claimId"/>" name="claimVoucherInfo.claimId" />
      </td>
                    </tr>
                  </thead>
                  <s:iterator var="claimVoucherDetailInfo" value="claimVoucherDetailInfoList" >
                   <tr>
                      <td>
                       <s:property value="#claimVoucherDetailInfo.dictionaryInfo.dictionaryItem"/>

//////////////////////////////////////此编号保存在隐藏域中  当数据库中没有数据的时候循环不会执行  所有就不会有此标签

当新增了数据的时候就会存在此标签  action中定义的claimVoucherDetailInfo对象接收

当再次提交的时候就会报   。。。 。。。。 。。。。 result   input

意思就是action中缺少result   name为input 的结果

把隐藏域中的name改了就可以了
                       <input type="hidden" value="<s:property value="#claimVoucherDetailInfo.dictionaryInfo.dictionaryId"/>"name="claimVoucherDetailInfo.dictionaryInfo.dictionaryId"/>
                    
                      </td>
                      <td>¥<s:property value="#claimVoucherDetailInfo.detailAccount"/></td>
                      <td><s:property value="#claimVoucherDetailInfo.detailDesc"/></td>
                         <td>
                           <img src="images/edit.gif" width="16" height="16"  alt="修改" />
                           <img src="images/delete.gif" width="16" height="16" alt="删除"/>
                         </td>
                   </tr>
                  </s:iterator>
                  <tr>
                   <td>
                        <select name="claimVoucherDetailInfo.dictionaryInfo.dictionaryId"id="select" class="input_01">
       <s:iterator var="dictionaryInfo" value="dictionaryInfoList">
        <option value="<s:property value="#dictionaryInfo.dictionaryId"/>">
         <s:property value="#dictionaryInfo.dictionaryItem" />
        </option>
       </s:iterator>
      </select>
                      </td>
                    <td><input type="text" name="claimVoucherDetailInfo.detailAccount" id="textfield2" class="input_01" value="" /></td>
                    <td><input type="text" name="claimVoucherDetailInfo.detailDesc" id="textfield" class="input_01" value="" /></td>
                    <td><img src="images/save.gif" width="16" height="16" alt="保存" onclick="imgSave()"/></td>
                  </tr>
                  <!--报销单事由-->
                   <tr><td colspan="4" class="event">
                    <label>事  由:</label><textarea name="claimVoucherInfo.claimEvent" id="textarea" cols="45" rows="5"><s:property value="claimVoucherInfo.claimEvent"/></textarea>
                   </td></tr>   
                   
                  <!--表单提交行-->
                  <tr>
                    <td colspan="4" class="submit">
                    <input type="button" name="button" id="button" value="保   存" class="submit_01" />
                    <input type="button" name="button" id="button" value="提 交" class="submit_01" />
                    <input type="button" name="button" id="button" value="返 回" class="submit_01" onclick="buttonBack()"/>
                    </td>
                  </tr> 
                 
                </table>    
                 </form>   

原创粉丝点击