With a forEach loop, I would like to create table cells (for a row), while each cell contains a form input field. The number of table cells is always fixed (12). This is actually not a problem. However, the problem arises here: forEach must also enter a variable number of default values ββin the input fields that must be received from the card (Long, Double).
This is my (simplified) attempt:
<c:forEach var="number" begin="1" end="12" >
<td>
<input type="text" value="${requestScope.aMapWithData[number]}" />
</td>
</c:forEach>
But this does not display the values ββfrom the Map in the input fields. I think the problem is that the "number" is of type String and not Long. So I wonder if this problem can be solved without using scripts.
source
share