0
Good morning, guys I’m killing myself to make my jsp return a list that comes from the BD, I’m taking the information from the bank and I can launch from 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>
he brings all in the same line and not one below the other.
could 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);
}
Maybe I misunderstood, but I did it right. Unfortunately it did not work colleague that is the return of my bank >> voltar web systems systems systems }, because if I repeat the process will repeat the same line, with all the contents of the list, not one by one for some reason it is not possible to pull also the Dice
– Rafael Lopes
I also tried this but did not list anything on the jsp & #Xa; <c:foreach var="lists" items="${lists}"> <tr> <td>${lists.system}</td> </tr> </c:foreach>
– Rafael Lopes
I edited my answer, see if it helps.
– escapistabr