First you should include the jstl tag to your jsp page as below:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
After that you can use the forEach tag to iterate the query list,below is the code that may be helpful to you:
<tr> <c:forEach items="${DataSource.attribute}" varStatus="status"> <td>${row.getAttribute(status.index)}</td> </c:forEach> </tr>
How to change for loop in jsp with jstl
Question
I would like to write this scriptless ?
<tr>
<% for (int column = 0; column < DataSource.getAttributeCount(); column++) { %>
<td><%=row.getAttribute(column)%></td>
<%
}
%>
</tr>
No correct solution
OTHER TIPS
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow