我有一个 JSP,我在其中迭代一个列表并创建一个可编辑的表。
<s:iterator value="test" id="countryList">
<tr>
<td><s:textfield name="countryCode" value="%{countryCode}" theme="simple" /></td>
<td><s:textfield name="countryName" value="%{countryName}" theme="simple" /></td>
</tr>
</s:iterator>
我的列表:
List<Country> test = new ArrayList<Country>();
国家级:
public class Country {
private String countryCode;
private String countryName;
and the getter setters......
并说我像这样填充列表:
Country country = new Country();
Country country1 = new Country();
country.setCountryCode("1");
country.setCountryName("India");
country1.setCountryCode("2");
country1.setCountryName("US");
test.add(country);
test.add(country1);
现在,当我在 JSP 中更改 和 的值时,我应该在我的操作中获得更新的值countrycode
。countryname
但我不能吗。有什么方法可以获取这些更新的值。