Struts 1:将jsp的值放入使用java列表的表单中
在我的 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;
}
问题是该列表未填充。 有什么想法吗??? 谢谢 !!
In my jsp, I have some fields like this :
<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">
And in my form I have a java.util.list that I need to populate from the fields on top :
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;
}
The problem is that the list is not populated.
Any ideas ???
Thanks !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,
1、如果是struts 1,美元“$”字段不起作用取值。
2.您不应该在属性名称中指定索引,但标签翻译器会自动使用它,因此您的代码看起来像
我希望这可以帮助您解决问题。
According to my knowledge,
1. If it is struts 1, the dollar "$" field does not work to take the values.
2. You should not specify the index in the property name, but it will be automatically used by the tag translator and hence your code will something look like
I hope this helps you to solve your problem.
只需执行此操作
并采用以下形式:
Simply do this
And in the form :