Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>Products overview</title>
- <link rel="stylesheet" type="text/css" href="css/style.css">
- </head>
- <body>
- <div id="container">
- <jsp:include page="JspFragments/Header.jsp"/>
- <h2>Products overview</h2>
- <main>
- <h3><a href="ShopController?action=gotoAddProductsForm">Add new product</a></h3>
- <form method="post" action="ShopController?action=updateProduct" novalidate="novalidate">
- <c:if test="${errors.size() >= 1}">
- <div class="alert-danger">
- <ul>
- <c:forEach var="error" items="${errors}">
- <li>${error}</li>
- </c:forEach>
- </ul>
- </div>
- </c:if>
- <!-- novalidate in order to be able to run tests correctly -->
- <p><label for="updateProductID">Id to update:</label><input type="text" id="updateProductID" name="updateProductID" value="<c:out value="${updateProductID}"/>" required value=""></p>
- <p><input type="submit" id="updateProduct" value="Search products"></p>
- </form>
- <table>
- <tr>
- <th>Id</th>
- <th>Description</th>
- <th>Price</th>
- <th>Delete</th>
- </tr>
- <c:forEach var="product" items="${products}">
- <tr>
- <td><a href="ShopController?action=updateProductWithGivenId&id=${product.id}">${product.id}</a></td>
- <td>${product.description}</td>
- <td>${product.price}</td>
- <td><a href="ShopController?action=deleteProductWithGivenId&id=${product.id}">Delete this product</a></td>
- </tr>
- </c:forEach>
- <caption>Products Overview</caption>
- </table>
- </main>
- <jsp:include page="JspFragments/Footer.jsp"/>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment