Advertisement
Guest User

Untitled

a guest
Jun 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <%@page import="java.util.ArrayList"%>
  2. <%@page import="editora.Artigo"%>
  3. <%@page import="editora.Autor"%>
  4. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  5.  
  6. <jsp:useBean id="dataManager" scope="application" class="editora.DataManager"/>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  11. <title>Obter artigos de Autor</title>
  12. <link rel="stylesheet" href="../css/estilo.css" type="text/css"/>
  13. </head>
  14. <body>
  15. <jsp:include page="header.jsp" flush="true"/>
  16. <jsp:include page="leftmenu.jsp" flush="true"/>
  17. <h1>Obter Artigos de Autor</h1>
  18.  
  19.  
  20.  
  21. <%String autor = request.getParameter("autor");
  22. if (autor != null) {
  23. ArrayList<String> nomes = dataManager.getAutorArtigos(Integer.parseInt(autor));
  24. %>
  25.  
  26.  
  27.  
  28. <p>Artigos do Autor:<p>
  29. <ul>
  30. <%for (int i = 0; i < nomes.size(); i++) {%>
  31. <p><%=nomes.get(i)%></p>
  32. <%}%>
  33. </ul>
  34.  
  35. <p></p>
  36.  
  37. <%
  38. } else {%>
  39. <form>
  40. <input type="hidden" name="action" value="listArtigo"/>
  41. <div class ="col-lg-4">
  42. <label>Qual o Artigo?</label>
  43. <%ArrayList<Autor> aut = dataManager.getAutor();%>
  44. <select id="autor" name="autor">
  45. <%for (int i = 0; i < aut.size(); i++) {%>
  46. <option value=<%=aut.get(i).getCod()%>><%=aut.get(i).getNome()%></option>
  47. <%}%>
  48. </select>
  49. <input type="submit" value="Pesquisar">
  50. </div>
  51. </form>
  52.  
  53. <%}%>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement