Implicit objects created by table

ID Name static value row number (testit_rowNum) ((ListObject)testit).getMoney()
28886 Sit Eos static 1 4039.0
70747 Diam Nonumy static 2 7491.0
74222 Kasd Amet static 3 7213.0
57291 Eos Dolor static 4 8973.0
22366 Gubergren At static 5 5528.0
38240 Sit Kasd static 6 6303.0
2007 Stet At static 7 2165.0
6306 Est Duo static 8 3414.0
68855 Voluptua Gubergren static 9 9516.0
72319 Sea Sanctus static 10 6402.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>