Hellboyandso

productsOverview

Nov 26th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.02 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6.     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1" />
  8.     <title>Products overview</title>
  9.     <link rel="stylesheet" type="text/css" href="css/style.css">
  10. </head>
  11. <body>
  12.     <div id="container">
  13.         <jsp:include page="JspFragments/Header.jsp"/>
  14.         <h2>Products overview</h2>
  15.         <main>
  16.             <h3><a href="ShopController?action=gotoAddProductsForm">Add new product</a></h3>
  17.             <form method="post" action="ShopController?action=updateProduct" novalidate="novalidate">
  18.                     <c:if test="${errors.size() >= 1}">
  19.                         <div class="alert-danger">
  20.                             <ul>
  21.                                 <c:forEach var="error" items="${errors}">
  22.                                     <li>${error}</li>
  23.                                 </c:forEach>
  24.                             </ul>
  25.                         </div>
  26.                     </c:if>
  27.                     <!-- novalidate in order to be able to run tests correctly -->
  28.                 <p><label for="updateProductID">Id to update:</label><input type="text" id="updateProductID" name="updateProductID" value="<c:out value="${updateProductID}"/>" required value=""></p>
  29.                 <p><input type="submit" id="updateProduct" value="Search products"></p>
  30.             </form>
  31.             <table>
  32.                 <tr>
  33.                     <th>Id</th>
  34.                     <th>Description</th>
  35.                     <th>Price</th>
  36.                     <th>Delete</th>
  37.                 </tr>
  38.                 <c:forEach var="product" items="${products}">
  39.                     <tr>
  40.                         <td><a href="ShopController?action=updateProductWithGivenId&id=${product.id}">${product.id}</a></td>
  41.                         <td>${product.description}</td>
  42.                         <td>${product.price}</td>
  43.                         <td><a href="ShopController?action=deleteProductWithGivenId&id=${product.id}">Delete this product</a></td>
  44.                     </tr>
  45.                 </c:forEach>
  46.                 <caption>Products Overview</caption>
  47.             </table>
  48.         </main>
  49.         <jsp:include page="JspFragments/Footer.jsp"/>
  50.     </div>
  51. </body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment