SSH中update更新操作无效——要在隐藏域中传id

 

一定要在隐藏域中放入主键id!  

 

<s:form action="stu_tosave" theme="simple">
   <input name="type" type="hidden" value="modifytype" />
   <s:hidden name="student.stuId"></s:hidden>

   <table border="1">
    <tr>
     <td>
      姓名
     </td>
     <td>
      <s:textfield name="student.stuName"></s:textfield>
     </td>
    </tr>
    <tr>
     <td>
      性别
     </td>
     <td>
      <s:radio list="#{'0':'女','1':'男'}" name="student.stuSex"></s:radio>
     </td>
    </tr>
    <tr>
     <td>
      年龄
     </td>
     <td>
      <s:textfield name="student.stuAge" />
     </td>
    </tr>
    <tr>
     <td>
      生日
     </td>
     <td>
      <input type="text" name="student.stuBirth" id="data"
       value="<s:date name='student.stuBirth' format='yyyy-MM-dd'/>" />
     </td>
    </tr>
    <tr>
     <td>
      爱好
     </td>
     <td>
      <s:checkboxlist name="student.stuHobby" list="hobbyMap" />
     </td>
    </tr>
    <tr>
     <td>
      状态
     </td>
     <td>
      <s:checkbox name="student.stuStatus" />
     </td>
    </tr>
    <tr>
     <td>
      班级
     </td>
     <td>
      <s:select name="student.classes.classId" list="classList"
       listKey="classId" listValue="className"></s:select>
     </td>
    </tr>
    <tr>
     <td colspan="2">
      <input type="submit" value="保存" />
     </td>
    </tr>
   </table>
  </s:form>

上一篇:Linux ct6.5安装rabbitmq


下一篇:linux的增删改查、压缩与解压缩