So, I have a list that I passed it through the model from my Spring controller to JSP. How do I iterate through the list inside the JSP?
Assume, the list has several hyperlinks that I would like to display in JSP. How to do this without scriptlets?
you can use jstl tag and display the list
<c:forEach var="listVar" items="${listName}"> //add the model attribute of list in items
<option value ="10"><c:out value="${listVar.attribute}"/></option>
</c:forEach>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With