Good morning, guys I'm killing myself to make my jsp return a list that comes from the DB, I'm getting the information from the bank and I can launch from the servlet to the jsp but not in an orderly and dynamic way, ends up pulling all the items in the same row, not in table form. <tr> <td><% out.print(obj.getSitema());%></td></tr>
it brings everyone on the same line and not one below the other.
Could you help me?
> JSP
<body>
<% incidenteDao inci = new incidenteDao();
Sistema sist = new Sistema();
for (Iterator it = inci.listaIncidentes().iterator(); it.hasNext();) {
obj = (Sistema) it.next(); %>
<tr>
<td><% out.print(obj.getSitema());%></td>
<tr>
<c:forEach var="lista" items="${lista}">
<tr>
<td><% out.print(obj.getSitema());%></td>
</tr>
</c:forEach>
> SERVLET
incidenteDao inciDao = new incidenteDao();
Sistema sistema = null;
List<Sistema> listas = inciDao.listaIncidentes();
request.setAttribute("listas", listas);
RequestDispatcher rd = request.getRequestDispatcher("teste.jsp");
rd.forward(request, response);
}