Hello
I have a servlet that creates results in a two dimentional array and then uses request.setAttribute to store it.
for example :
String[][] fullname = {{"name1", "surname1"},{"name2", "surname2"},{"name3", "surname3"}};
request.setAttribute("fullname",fullname);
Then JSP page will use JSTL c:foreach to display it:
<c:forEach var = "itemarr2" items = "${fullname}">
<tr>
<td>${itemarr2[0]}</td>
<td>${itemarr2[1]}</td>
</tr>
</c:forEach>
The above is working fine, except that in this case I know the array has two columns, but in many cases I don't know how many columns I have. Is there a way to make column numbers dynamic ?
Or may be another tag or method to solve this problem ?
Thank you
Lisa