Advertisement
chrisenoch

cart.jsp

Oct 3rd, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Murach's Java Servlets and JSP</title>
  6. <link rel="stylesheet" href="styles/main.css" type="text/css"/>
  7. </head>
  8. <body>
  9.  
  10. <h1>Your cart</h1>
  11.  
  12. <table>
  13. <tr>
  14. <th>Quantity</th>
  15. <th>Description</th>
  16. <th>Price</th>
  17. <th>Amount</th>
  18. <th></th>
  19. </tr>
  20. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  21. <c:forEach var="item" items="${cart.items}">
  22. <tr>
  23. <td>
  24. <form action="" method="post">
  25. <input type="hidden" name="productCode"
  26. value="<c:out value='${item.product.code}'/>">
  27. <input type=text name="quantity"
  28. value="<c:out value='${item.quantity}'/>" id="quantity">
  29. <input type="submit" value="Update">
  30. </form>
  31. </td>
  32. <td><c:out value='${item.product.description}'/></td>
  33. <td>${item.product.priceCurrencyFormat}</td>
  34. <td>${item.totalCurrencyFormat}</td>
  35. <td>
  36. <form action="" method="post">
  37. <input type="hidden" name="productCode"
  38. value="<c:out value='${item.product.code}'/>">
  39. <input type="hidden" name="quantity"
  40. value="0">
  41. <input type="submit" value="Remove Item">
  42. </form>
  43. </td>
  44. </tr>
  45. </c:forEach>
  46. </table>
  47.  
  48. <p><b>To change the quantity</b>, enter the new quantity
  49. and click on the Update button.</p>
  50.  
  51. <form action="" method="post">
  52. <input type="hidden" name="action" value="shop">
  53. <input type="submit" value="Continue Shopping">
  54. </form>
  55.  
  56. <form action="" method="post">
  57. <input type="hidden" name="action" value="checkout">
  58. <input type="submit" value="Checkout">
  59. </form>
  60.  
  61. </body>
  62. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement