Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- System.out.println("Chamando doGet");
- PrintWriter resposta = resp.getWriter();
- resposta.println("<html><body>");
- resposta.println("<strong>TESTANDO FORTE</strong>");
- resposta.println("<ul>");
- for (Artista u : new ArtistaDAO().getArtistas()) {
- resposta.println("<li>" + u.getNome() + "</li>");
- }
- resposta.println("</ul>");
- resposta.println("</body></html>");
- RequestDispatcher disp = req.getRequestDispatcher("/WEB-INF/views/inicio.jsp");
- disp.forward(req, resp);
- }
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- ...
- ...
- ...
- <c:forEach items="${nomeartistas}" var="artista">
- <li>${artista.getNome()}</li>
- </c:forEach>
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- req.setAttribute("nomeartistas", new ArtistaDAO().getArtistas());
- req.getRequestDispatcher("inicio.jsp").forward(req, resp);
- }
Add Comment
Please, Sign In to add comment