In my jsp:
<jsp:useBean id = "b" class = "pack1.userBean" scope="application" />
<tr>
<td> <c:out value ="firstName"/> </td>
<td> <c:out value ="${b.firstName}"/> </td>
</tr>
<tr>
<td> <c:out value ="lastName"/> </td>
<td> <c:out value ="${b.lastName}"/> </td>
</tr>
This is working fine, but how can i iterate each value from userBean in a loop instead of typing each value over and over ?
Look like: (doesn't work)
<c:forEach var="p" items="${b}">
<tr>
<td> <c:out value ="${p.key}"/> </td>
<td> <c:out value ="${p.value}"/> </td>
</tr>
</c:forEach>
header: (working fine)
<c:forEach var="h" items="${header}">
<tr>
<td> <c:out value ="${h.key}"/> </td>
<td> <c:out value ="${h.value}"/> </td>
</tr>
</c:forEach>
Can anyone help? Thanks.