Implicit objects created by table

ID Name static value row number (testit_rowNum) ((ListObject)testit).getMoney()
64695 At Nonumy static 1 6041.0
54970 Sed Elitr static 2 8724.0
48970 Aliquyam Ut static 3 521.0
602 Sea Sea static 4 8576.0
16270 Invidunt Ipsum static 5 1801.0
74769 Ut Ut static 6 9865.0
97777 Ut Invidunt static 7 921.0
38717 Elitr Amet static 8 1298.0
42260 Nonumy Takimata static 9 5422.0
71413 Voluptua Ipsum static 10 8630.0

If you add an id attribute the table tag makes the object corresponding to the given row available in the page context so you could use it inside scriptlet code or some other tag. Another implicit object exposed by the table tag is the row number, named id_rowNum.

These objects are saved as attributes in the page scope (you can access it using pageContext.getAttribute("id")). They are also defined as nested variables (accessible using <%=id%>), but only if the value of the id atribute is not a runtime expression. The preferred way for fetching the value is to always use pageContext.getAttribute().

If you do not specify the id attribute no object is added to the pagecontext by the table tag

This is a simple snippet which shows the use of the implicit objects created by the table tag with JSTL.


  <display:table id="row" name="mylist">
    <display:column title="row number" >
      <c:out value="${row_rowNum}"/>
    </display:column>
    <display:column title="name" >
      <c:out value="${row.first_name}"/>
      <c:out value="${row.last_name}"/>
    </display:column>
  </display:table>