在我的jsp中,我有一些这样的字段:
<html:text property="field[0]" value="${fieldValue}" indexed="true">
<html:text property="field[1]" value="${fieldValue}" indexed="true">
<html:text property="field[2]" value="${fieldValue}" indexed="true">
<html:text property="field[3]" value="${fieldValue}" indexed="true">
在我的表单中,我有一个 java.util.list,我需要从顶部的字段中填充它:
private List<Double> field = new ArrayList<Double>();
public final List<Double> getField() {
return field;
}
public final void setField(final List<Double> valeur) {
this.field = valeur;
}
问题是该列表未填充。
有任何想法吗 ???
谢谢 !!
最佳答案
据我所知,
1、如果是struts 1,美元“$”字段取值不起作用。
2. 你不应该在属性名称中指定索引,但它会被标签翻译器自动使用,因此你的代码看起来像
<html:text property="field" indexed="true">
<html:text property="field" indexed="true">
<html:text property="field" indexed="true">
<html:text property="field" indexed="true">
我希望这可以帮助您解决您的问题。
关于forms - 支柱 1 : Put values of a jsp into form that uses a java List,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8384644/