1

I am getting error message

org.springframework.beans.NotReadablePropertyException: Invalid property 'produts[0]' of bean class [java.util.HashMap]: Bean property 'produts[0]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

when i perform following in jsp file

<c:forEach items="${model.products}" var="prod"> varStatus="loop">
  <tr>
  <td align="center">
    <form:checkbox path="produts[${loop.index}].selected"></form:checkbox>
  </td>
  <td><c:out value="${prod.description}"/> </td>
  <td>$<c:out value="${prod.price}"/></td>
  </tr>
</c:forEach>

products is populated by List<Product> getProducts(); in another class.

What i am doing wrong?

2 Answers 2

1

Looks like a typo to me:

produts[${loop.index}]

should be

products[${loop.index}]
Sign up to request clarification or add additional context in comments.

1 Comment

It is a typo but i am getting same error message org.springframework.beans.NotReadablePropertyException: Invalid property 'products[0]' of bean class [java.util.HashMap]: Bean property 'products[0]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
1

Since you are already in the forEach loop, why cant you just use ${prod.selected} instead of products[${loop.index}].selected?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.