Can't access a property with <html:checkbox property="..."> when iterating a list

Posted by Bernhard V on Stack Overflow See other posts from Stack Overflow or by Bernhard V
Published on 2010-06-17T11:19:48Z Indexed on 2010/06/17 15:33 UTC
Read the original article Hit count: 153

Filed under:
|
|
|
|

Hi.

In my Struts form I've got a list. In a JSP I iterate over it like this:

<c:forEach items="${MyForm.auspraegungen}" var="auspraegung">
    <tr>
        <td>${auspraegung.name}</td>
        <td>${auspraegung.forced}</td>
        <td>${auspraegung.cbx_uebernehmen}</td>
        <html:checkbox property="auspraegung.cbx_uebernehmen" />
    </tr>
</c:forEach>

Now the <html:checkbox isn't working. I'm always getting the following error:

Caused by: javax.servlet.jsp.JspException: No getter method for property auspraegung.cbx_uebernehmen of bean org.apache.struts.taglib.html.BEAN

But actually there is a getter for this property in my form class. It's written like this:

public Boolean getCbx_uebernehmen() {
  return cbx_uebernehmen;
}

When I remove the checkbox it's also possible to display the property as in the <td>-tag above so I don't know where the problem is.

Maybe I'm accessing it in the wrong way?

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp