Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  4.  
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  9. <title>Tiedot</title>
  10. </head>
  11. <body>
  12.  
  13. <h1>Tiedot</h1>
  14.  
  15. <form action="TiedotServlet" method="get">
  16. Choose:<br>
  17. <select name="choice">
  18. <option></option> <!-- ensimmäisenä tyhjä vaihtoehto -->
  19. <c:forEach var="a" items="${tiedot}">
  20. <option>${a.nimi }</option>
  21. </c:forEach>
  22. </select>
  23. <input type="submit" value="Submit">
  24. </form>
  25.  
  26.  
  27.  
  28. <c:if test="${not empty atiedot }">
  29. <h2>Detailed information</h2>
  30. <p>
  31. <table>
  32. <tr><td>Nimi:</td><td> ${atiedot.nimi }</td></tr>
  33. <tr><td>Lahiosoite:</td><td> ${atiedot.osoite }</td></tr>
  34. <tr><td>Postinumero:</td><td> ${atiedot.postinumero }</td></tr>
  35. <tr><td>Postitoimipaikka:</td><td> ${atiedot.postitoimipaikka }</td></tr>
  36. </table>
  37.  
  38. </c:if>
  39.  
  40. <form action="TiedotServlet" method="get">
  41. Valinta:<br>
  42. <select name="valinta">
  43. <option></option> <!-- ensimmäisenä tyhjä vaihtoehto -->
  44. <c:forEach var="b" items="${tiedot}">
  45. <option>${b.postinumero }</option>
  46. </c:forEach>
  47. </select>
  48. <input type="submit" value="Submit">
  49. </form>
  50.  
  51. <c:if test="${not empty Postinumerot}">
  52. <h2>Detailed information</h2>
  53. <p>
  54. <table>
  55. <c:forEach var="btiedot" items="${Postinumerot}">
  56. <tr><td>Nimi:</td><td> ${btiedot.nimi }</td></tr>
  57. <tr><td>Lahiosoite:</td><td> ${btiedot.osoite }</td></tr>
  58. <tr><td>Postinumero:</td><td> ${btiedot.postinumero }</td></tr>
  59. <tr><td>Postitoimipaikka:</td><td> ${btiedot.postitoimipaikka }</td></tr>
  60. </c:forEach>
  61. </table>
  62.  
  63. </c:if>
  64.  
  65.  
  66. </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement