Implicit objects created by table

ID Name static value row number (testit_rowNum) ((ListObject)testit).getMoney()
17110 Accusam Aliquyam static 1 5841.0
62426 Et No static 2 954.0
1298 Sed No static 3 4304.0
8559 Elitr At static 4 2208.0
53752 Nonumy Sanctus static 5 3197.0
8851 Magna Dolor static 6 5055.0
14346 Voluptua Et static 7 297.0
65151 Invidunt No static 8 8097.0
35138 Tempor Sadipscing static 9 9099.0
13960 Et Justo static 10 4412.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>