-3

I'm try show my data into JSP using JSTL, but console show me javax.el.PropertyNotFoundException: The class 'java.lang.Integer' does not have the property '0' I have a List<Object> with Integer and BigDecimal and my JSP I did put

<c:forEach items="${obj}" var="object">
   <tr>
      <td width="10%" class="r1Left">${object[0].id}</td>
   </tr>
</c:forEach>

My List<Object> contain [10, 1278612143.23, 10, 3343443.56, 4, 123.45]

Please help me.

hekomobile
  • 1,388
  • 1
  • 14
  • 35

1 Answers1

3

I think you just want ${object.id}, you are getting the object not the list at this point.

Rocky Pulley
  • 22,531
  • 20
  • 68
  • 106
  • You definitely don't want the `[0]`. The JSTL `foreach` tag makes the `var` object be a single object, not the List itself. Once you removed that, you should have at least gotten a different error. But if the objects in the List are Integers, `.id` isn't going to work since Integer has no `id` property (no `getId()` method). – dbreaux Aug 18 '12 at 22:46
  • maybe you just want ${object} – Rocky Pulley Aug 21 '12 at 14:39