Domanda

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.

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top