home *** CD-ROM | disk | FTP | other *** search
/ ftp.disi.unige.it / 2015-02-11.ftp.disi.unige.it.tar / ftp.disi.unige.it / pub / .person / CataniaB / teach-act / DB3 / servlet-bean-jsp / visTuttiStudenti.jsp < prev   
Text File  |  2001-04-02  |  2KB  |  61 lines

  1. <%--visTuttiStudenti.jsp
  2.   Stampa i dati di un studente
  3. --%>
  4. <%@ page errorPage="/jsp/error.jsp" %>
  5.  
  6. <%@ page import="StudenteBean" %>
  7. <%@ page import="java.text.DateFormat" %>
  8. <%@ page import="java.util.Locale" %>
  9.  
  10. <%! DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.ITALY); %>
  11.  
  12. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  13.       "http://www.w3.org/TR/REC-html40/loose.dtd">
  14.  
  15. <html>
  16. <head>
  17.   <title>
  18.     Gestione studenti
  19.   </title>
  20.   <base href="<%= request.getScheme() %>://<%= request.getServerName()%>:<%= request.getServerPort() %><%= request.getContextPath() %>/">
  21. </head>
  22.  
  23. <body>
  24.   <h1>Lista studenti</h1>
  25.  
  26.   <% Vector lista = (Vector)request.getAttribute("listaStudenti"); 
  27.      StudenteBean studente = new StudenteBean(); %>
  28.  
  29.   <table border="1">
  30.   <tr>
  31.   <td><strong>Matricola</strong></td>
  32.   <td><strong>Cognome</strong> </td>
  33.   <td><strong>Nome</strong></td>
  34.   <td><strong>Facoltà</strong></td>
  35.   <td><strong>Data di nascita</strong></td>
  36.   <td><strong>Crediti ottenuti</strong></td>
  37.   </tr>
  38.  
  39.   <% for (int i=0; i<lista.size(); i++) { 
  40.       studente = (StudenteBean) lista.get(i); %>
  41.  
  42.   <tr>
  43.   <td><%= studente.getMatricola() %></td>
  44.   <td><%= studente.getCognome() %></td>
  45.   <td><%= studente.getNome() %></td>
  46.   <td><%= studente.getFacolta() %></td>
  47.   <td><%= df.format(studente.getDataNascita()) %></td>
  48.   <td><%= studente.getCreditiOttenuti() %></td>
  49.  
  50.   </tr>
  51.   <% } %>
  52.  
  53.   </table>
  54.  
  55.   <p>
  56.   <a href="http://validator.w3.org/check/referer">Valida il documento</a>
  57.   </p>
  58.  
  59. </body>
  60. </html>
  61.