Guest User

ecomm home page

a guest
Nov 13th, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset = UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ page errorPage="error.jsp"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  5. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  6.  
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <title>Kelly's Ski Equipment</title>
  11. <link rel="stylesheet" href="style.css" type="text/css"></link>
  12. </head>
  13. <body>
  14.  
  15. <sql:setDataSource var="myDS" driver="org.postgresql.Driver"
  16. url="jdbc:postgresql://localhost:5433/skistuff" user="zeropostgres"
  17. password="zero" />
  18.  
  19. <sql:query var="listStuff" dataSource="${myDS}">
  20. SELECT * FROM skisEtc ORDER BY id;
  21. </sql:query>
  22.  
  23. <center>
  24. <h3>Kelly's Ski Equipment</h3>
  25. </center>
  26. <div align="center">
  27. <form action="productOrderHandler" method="post">
  28. <table class="products" border="1" cellpadding="5">
  29. <tr>
  30. <th>Buy</th>
  31. <th>Qty</th>
  32. <th>Id</th>
  33. <th>Product</th>
  34. <th>Category</th>
  35. <th>Price</th>
  36. </tr>
  37. <!-- variable ind is used to check whether product is selected or not. for more details check code inside servlet handle Order -->
  38. <c:set var='ind' value='1' scope='page' />
  39.  
  40. <c:forEach var="item" items="${listStuff.rows}">
  41. <tr>
  42. <td><input type="checkbox" name="check-${ind}" value="${ind}" /></td>
  43. <td><input type="number" name="num-${ind}" min="0" max="99"
  44. step="1" value="0" size="3" /></td>
  45. <td><input type="text" name="id-${ind}" value="${item.id}"
  46. size="4" readonly /></td>
  47. <td><input style="text-align: center;" name="prod-${ind}"
  48. type="text" value="${item.product}" readonly /></td>
  49. <td><input style="text-align: center;" name="cat-${ind}"
  50. type="text" value="${item.category}" readonly /></td>
  51. <td><input type="text" name="price-${ind}"
  52. value="${item.price}" size="7" readonly /></td>
  53. </tr>
  54. <c:set var='ind' value='${ind + 1}' />
  55. </c:forEach>
  56.  
  57. <input type="hidden" value="${listStuff.rowCount}" name="rowCount" />
  58. </table>
  59. <p>
  60. <input type="submit" value=" Submit order " />
  61. </form>
  62. </div>
  63. </body>
  64. </html>
  65.  
  66.  
  67.  
  68. this is the ecomm_shop home page
Add Comment
Please, Sign In to add comment