struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JOEL VOGT <joel.v...@studentmail.newcastle.edu.au>
Subject Form question
Date Sun, 01 Apr 2001 05:05:03 GMT
Hi all,

I need help in how to write a form bean. I have the following problems:

I have a jsp, with something like the following: It has to allow the 
user to change any number of fields. After submit is clicked, all these 
fields should be sent to a form before being processed.

<html:form action"/perform.do">
<table>
  <% i=0; %>
  <logic:iterate name="bean" property="items" id ="id">
    <bean:write name="bean" property='<%=                         
items["+i+"].username" %>' filter="true" />
  <% i++; %>
  </logic:iterate>
</table>
<html:submit />
</html:form>

in my bean, I have:
item[] item;
item[] getItem()
item getItem(int id)
void setItem()
void setItem(int id, item item)

in my perform action,
I use form.getItem() to get the items out of the form, and then I 
perform some operations on them.
The question is, how do I write the form? Btw, is there a better struts 
way to do this whole thing?

Thanks, Joel.


Mime
View raw message