在webwork中表单页面有多条记录,这些数据是数据库中提取的,如下显示list<#list wFUnitList as result>
     <tr>
            <td><input name="unitName" id="unitName" value="${result.unitName}"></td>
            <td><input name="currTime" id="currTime" type="text" readonly="true"  value="${currTime}"/></td>
            <td><input name="count" id="count"   type="text"  /></td>
          </tr>
</#list>
 
这些显示的数据,如何在表单提交时依次插入到数据库里面,action代码怎么写

解决方案 »

  1.   

    在action 里获得每一个标签的value  然后插入数据库
      

  2.   

    action里面要有unitName,currTime,count三个成员变量并有get、set方法。
    或者取得request,用request.getParameter();
      

  3.   

    Action中变量定义为数组就行了,名称规则同一般变量。
      

  4.   

    action里面定义unitName,currTime,count三个成员变量并有get、set方法。
      

  5.   

    +!
    ------ Good luck!!!