There are two different things you need to understand thoroughly in order to perform this task:
1- You need to understand how indexed properties work in Struts.
This link explains the basics of indexed properties. I'd suggest you create a few
test pages trying out some of the techniques offered in this link.
2- You need to understand how radio buttons work. The main thing you need to understand is that when you have more than one radio button with the same property name, they all update the same property with different values depending on which one is checked. So, in your example, you will need three <html:radio> tags all with the same property attribute, but with different value attributes.
Here's a simple example that you can extrapolate to match what you're doing:
ActionForm public class ItemForm extends ActionForm {
private List items;
public List getItems() { return items; }
public void setItems(List items) {this.items = items; }
public Item getItem(int index) {return (Item)items.get(index);}
public void setItem(int index, Item item) { items.set(index, item);}
}
Item class public class Item {
private
String name;
private String number;
private String color;
// getters and setters
}
JSP <table>
<logic:iterate id="item" name="itemForm" property="items">
<tr>
<td>Number:<html:text name=item" property="number" indexed="true"/></td>
<td>Name:<html:text name=item" property="name" indexed="true"/></td>
<td>color:<html:radio name=item" property="color" value="red" indexed="true"/>red<html:radio name=item" property="color" value="blue" indexed="true"/>blue<html:radio name=item" property="color" value="green" indexed="true"/>green</td>
</tr>
</logic:iterate>
</table>
In order to make this work, I'd suggest you put your form bean in session scope rather than request scope. It's easier to get it working and see results this way. If you really don't want it to be in session scope, then you will have to change your indexed getters to use a "lazy initialization" technique to make sure the list is populated before trying to get or set one of it's values.