在我的 Struts 表单中,我有一个列表。在 JSP 中,我像这样迭代它:
<c:forEach items="${MyForm.types}" var="type">
<tr>
<td>${type.name}</td>
<td>${type.forced}</td>
<td>${type.receive}</td>
<html:checkbox property="type.receive" />
</tr>
</c:forEach>
现在<html:checkbox
不工作了。我总是收到以下错误:
Caused by: javax.servlet.jsp.JspException: No getter method for property type.receive of bean org.apache.struts.taglib.html.BEAN
但实际上在我的表单类中有这个属性的吸气剂。它是这样写的:
public Boolean getReceive() {
return receive;
}
当我删除复选框时,也可以像<td>
上面的 -tag 一样显示属性,所以我不知道问题出在哪里。
也许我以错误的方式访问它?