您需要在拦截器使用索引属性访问填充列表
Country时创建该对象
params。
<s:iterator value="test" id="countryList" status="stat"> <tr> <td><s:textfield name="countryList[%{#stat.index}].countryCode" value="%{countryCode}" theme="simple" /></td> <td><s:textfield name="countryList[%{#stat.index}].countryName" value="%{countryName}" theme="simple" /></td> </tr> </s:iterator>要让Struts填充列表,您应该在xml配置中使用类型转换批注或等效项。
@Element(value = Country.class)@Key(value = String.class)@KeyProperty(value = "countryCode") @CreateIfNull(value = true)private List<Country> countryList = new ArrayList<Country>;



