【发布时间】:2013-09-09 00:14:47
【问题描述】:
我有一个 JSP,它有两个标签、四个复选框和四个文本字段。由于这是一组数据并且可以是动态的,因此这些字段存储在一个值对象中并存储在一个列表中,并将此列表传递给操作类。
问题是,当提交表单时,我无法通过表单将更新的值列表获取到 Struts 中。我正在使用 Struts 1.2.9
下面JSP的代码sn-p:
<logic:iterate name="monthlyGainLossForm" property="ptcList" id="ptc">
<mf:td>
<html:text name="ptc" property="ptcName" />
<html:hidden name ="ptc" property="ptcName"/>
</mf:td>
<mf:td>
<html:text name="ptc" property="ptcActive" />
</mf:td>
<html:hidden name ="ptc" property="ptcActive"/>
<mf:td>
<html:checkbox name="ptc" disabled="false" property="msaPtcLtcGLType" styleClass="input"/>
<html:hidden name ="ptc" property="msaPtcLtcGLType"/>
</mf:td>
<mf:td>
<html:text name="ptc" readonly="true" property="msaPtcLtcGLAmt" styleClass="input"/>
<html:hidden name ="ptc" property="msaPtcLtcGLType"/>
</mf:td>
【问题讨论】:
-
我注意到,在格式化您的代码时,您似乎有一个 结束标记放置不正确;不应该是之后
<html:hidden name ="ptc" property="ptcActive"/>,而不是之前?我不知道这是否是问题,但至少它是 a 问题... -
您要么没有提交,要么无法编译。你尝试了什么?你有一个具体的问题吗?为了尽快获得更好的帮助,请发布SSCCE。