Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsp 复选框未更新struts上的属性_Jsp_Checkbox_Struts_Struts 1 - Fatal编程技术网

Jsp 复选框未更新struts上的属性

Jsp 复选框未更新struts上的属性,jsp,checkbox,struts,struts-1,Jsp,Checkbox,Struts,Struts 1,我有一份样品清单,下面有一份测试清单。我正在设置添加到html:复选框的属性。选中该复选框时,添加变量的值不会更改 <logic:iterate id="samples" name="<%=formName%>" property="samples" indexId="sampleIndex" type="Sample"> <tr> <td>

我有一份样品清单,下面有一份测试清单。我正在设置添加到html:复选框的属性。选中该复选框时,添加变量的值不会更改

<logic:iterate id="samples" name="<%=formName%>" property="samples" indexId="sampleIndex"
                       type="Sample">

            <tr>
                <td>
                <span class="itemNumber">
                    <bean:write name="samples" property="accessionNumber"/>
                </span>
                </td>
                <td>
                    <bean:write name="samples" property="sampleType"/>
                </td>
                <td>
                    <ul>
                        <logic:iterate id="tests" name="samples" property="tests" indexId="testIndex"
                                       type="Test">
                            <li class="test-name">
                                <html:hidden name="tests" property="testId" indexed="true"/>
                                <label>
                                    <html:checkbox name="tests" property="added" indexed="true" value="true"/>
                                    <bean:write name="tests" property="testName"/>
                                    <bean:write name="tests" property="added"/>
                                </label>
                            </li>
                        </logic:iterate>
                    </ul>
                </td>
            </tr>
        </logic:iterate>
我对样本设置如下值:

PropertyUtils.setProperty(dynaForm, "samples", possibleSampleList);
有人能帮我理解为什么它不改变所添加属性的值吗

<html:checkbox name="tests" property="added" indexed="true" value="true"/>
对下列事项:

<input type="checkbox" name="samples[<bean:write name='sampleIndex'/>].tests[<bean:write name='testIndex'/>].added">

修正了这个问题。

你说的是什么变量?复选框的属性,它是“添加”在你定义列表的代码后。PropertyUtils.setPropertydynaForm,samples,possibleSampleList;
<input type="checkbox" name="samples[<bean:write name='sampleIndex'/>].tests[<bean:write name='testIndex'/>].added">