You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Will Spies/Towers Perrin <sp...@towers.com> on 2001/04/09 15:34:53 UTC

POSTing arrays in struts


I've read a couple archived notes on this topic and it's not helping me so
here goes.

I'm trying to post an array of data from my view (JSP) into my bean. I'm
having great difficulty. Here is a JSP snipet of what I'm doing:

<html:form action="/saveEmployees">
<table>
  <tr>
    <td align="left">
      <html:text property="data.rows[1].EmployeeName" size="30" maxlength
="30"/>
    </td>
  </tr>
  <td align="right">
   <html:submit>
       <bean:message key="button.save"/>
   </html:submit>
  </td>
  <td align="left">
    <html:reset>
        <bean:message key="button.reset"/>
    </html:reset>
    &nbsp;
    <html:cancel>
      <bean:message key="button.cancel"/>
    </html:cancel>
    </td>
</table>
</html:form>

My form consists of a getData().getRows().EmployeeName. The Rows is the
array. I've added the appropriate getRows(int index) and setRows(int index,
...). Still, it doesn't work. Upon the post I do not see my getters being
called and I get no data in my corresponding form. Help???