<input type = "hidden" name = "aa" value = "<%= out.println(i)%>">

解决方案 »

  1.   

    <html:hidden name="名称" value=<%=i%> />
      

  2.   

    <html:hidden name="名称" value=<%=i%> />
    这种方法我试过,value得到是整型值,没办法传到form里
      

  3.   

    to:<html:hidden name="名称" value=<%=i%> />
    这种方法我试过,value得到是整型值,没办法传到form里
    它是不是在form里面?如果是的且还不能得到值的话就有点不正常,你改下
    <html:hidden name="名称" value=<%="\"" + i "\""%> />再试一下.
      

  4.   

    使用Struts的logic标签,遍历List时使用indeId来自动输出序号并加一
    例子如下:<table>
    <tr>
    <td>序号</td>
    <td>姓名</td>
    ...
    </tr>
    <logic:present name="targetbean">
    <logic:iterate name='helperbean' id='helperbean' type='net.echochina.HelperBean' scope='request' indexId="index">
    <tr>
    <td><%= index.intValue() + 1 %></td>
    <td><bean:write name='helperbean' property='name' /></td>
    .....
    </tr>
    </logic:iterate>
    </logic:present>
    </table>
      

  5.   

    在大家的提示下我找到这个方法
    <logic:iterate id="prinfo" name="optionalMethods" scope="session" indexId="index"> 
       <tr>
         <td width="780" height="40" align="left">
          <bean:write name="prinfo" />
         </td>
         <td width="20">
          <html:form action="/Select.do">
      <html:hidden property="selectedIndex" value= "<%=index.toString()%>" />
     <html:submit property="submit" value="add"/>
     </html:form>