Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <%@page import="java.util.List"%>
  3. <%@page import="cl.entity.Departamento"%>
  4. <%@page import="javax.naming.InitialContext"%>
  5. <%@page import="cl.bean.ServiciosEmpleadoLocal"%>
  6. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  7. <%! ServiciosEmpleadoLocal servicio; %>
  8. <%
  9. InitialContext ctx = new InitialContext();
  10. servicio = (ServiciosEmpleadoLocal) ctx.lookup("java:global/MantenedorEmpleadosJPA/MantenedorEmpleadosJPA-ejb/ServiciosEmpleado!cl.bean.ServiciosEmpleadoLocal");
  11. List<Departamento> listaDep = servicio.getDepartamento();
  12. %>
  13. <c:set scope="page" var="lista" value="<%= listaDep %>" />
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17. <!--Import Google Icon Font-->
  18. <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  19. <!--Import materialize.css-->
  20. <link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
  21.  
  22. <!--Let browser know website is optimized for mobile-->
  23. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  24. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  25. <title>Gestión de Departamentos</title>
  26. </head>
  27. <body>
  28. <div class="container">
  29. <div class="row">
  30. <div class="col s12">
  31. <c:import url="nav.jsp"/>
  32. </div>
  33. </div>
  34. <h3 class="center-align">Mantenedores - Departamento</h3>
  35. <div class="row card-panel z-depth-5 ">
  36. <form action="adddep.do" method="post"
  37. class="card-panel col s8 offset-s2">
  38. <div class="row">
  39. <div class="input-field col s12 ">
  40. <i class="material-icons prefix">payment</i>
  41. <input id="icon_nombre" type="text" class="validate"
  42. name="txtNombre">
  43. <label for="icon_nombre">Nombre</label>
  44. </div>
  45. </div>
  46. <div class="input-field col s6">
  47. <button class="btn waves-effect waves-light" type="submit" name="action">
  48. Agregar
  49. <i class="material-icons right">done_all</i>
  50. </button>
  51. </div>
  52. </form>
  53. <div class="col s8 offset-s2">
  54. <p style="color:red;">${requestScope.msg}</p>
  55. </div>
  56. </div>
  57. <div class="row">
  58. <div class="card-panel col s8 offset-s2 z-depth-5">
  59. <!-- Tabla de Productos -->
  60. <table class="bordered highlight">
  61. <thead>
  62. <tr>
  63. <th>Código</th>
  64. <th>Nombre</th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <c:forEach var="d" items="${lista}">
  69. <tr>
  70. <td>${d.codDepartamento}</td>
  71. <td>${d.nombre}</td>
  72. </tr>
  73. </c:forEach>
  74. </tbody>
  75. </table>
  76.  
  77. </div>
  78. </div>
  79.  
  80. </div>
  81. </div><!-- fin container -->
  82. <!--Import jQuery before materialize.js-->
  83. <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  84. <script type="text/javascript" src="js/materialize.min.js"></script>
  85. </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement