Question

I have a person object and was wondering if I can use JSTL to do something like this:

                        <c:forEach items="${user}" var="element"> 
                      <tr>
                        <td>${element.firstname}</td>
                        <td>${element.lastname}</td>
                        <td>${element.age}
                      </tr>
                    </c:forEach> 

everything I've found so far points to collections or an array list. user is stored as a session variable.

Is this possible?
Many thanks.

Was it helpful?

Solution

no its not possible to iterate an user object. you can iterate only collections. because it is a single object .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top