Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page import="java.util.ArrayList"%>
- <%@page import="editora.Artigo"%>
- <%@page import="editora.Autor"%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <jsp:useBean id="dataManager" scope="application" class="editora.DataManager"/>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Obter artigos de Autor</title>
- <link rel="stylesheet" href="../css/estilo.css" type="text/css"/>
- </head>
- <body>
- <jsp:include page="header.jsp" flush="true"/>
- <jsp:include page="leftmenu.jsp" flush="true"/>
- <h1>Obter Artigos de Autor</h1>
- <%String autor = request.getParameter("autor");
- if (autor != null) {
- ArrayList<String> nomes = dataManager.getAutorArtigos(Integer.parseInt(autor));
- %>
- <p>Artigos do Autor:<p>
- <ul>
- <%for (int i = 0; i < nomes.size(); i++) {%>
- <p><%=nomes.get(i)%></p>
- <%}%>
- </ul>
- <p></p>
- <%
- } else {%>
- <form>
- <input type="hidden" name="action" value="listArtigo"/>
- <div class ="col-lg-4">
- <label>Qual o Artigo?</label>
- <%ArrayList<Autor> aut = dataManager.getAutor();%>
- <select id="autor" name="autor">
- <%for (int i = 0; i < aut.size(); i++) {%>
- <option value=<%=aut.get(i).getCod()%>><%=aut.get(i).getNome()%></option>
- <%}%>
- </select>
- <input type="submit" value="Pesquisar">
- </div>
- </form>
- <%}%>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement