I have this code which iterates through ArrayList<String> towns = new ArrayList<String>(); using JSTL but I keep getting alternating blank entries (every 2nd row) even if the ArrayList does not show any blank entries, so I’m not sure whats going on.
<c:if test="${!empty towns }">
<select id="town">
<c:forEach items="${towns}" varStatus="loop">
<option value="${towns[loop.index]}">${towns[loop.index]}<option>
</c:forEach>
</select>
</c:if>
It should be
</option>on the end.