]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - web/finished.jsp
Continued with project:
[pizzaservice-war.git] / web / finished.jsp
index 6adaf51a49490820a668134982069c5b7ed0505f..4f574d8b2b4502c9ca000a4697a4e2968fa17b1c 100644 (file)
@@ -7,6 +7,7 @@
 <%--<%@page errorPage="errorHandler.jsp" %>--%>
 <%@page contentType="text/html" pageEncoding="UTF-8"%>
 
+<%@page import="java.lang.reflect.Field"%>
 <%@page import="java.util.Map"%>
 <%@page import="java.util.Iterator"%>
 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
@@ -14,7 +15,7 @@
 <%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
 
-<jsp:useBean id="customer" scope="request" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
+<jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
 <jsp:setProperty name="customer" property="*" />
 
 <%
@@ -25,7 +26,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Vielen Dank!</title>
        </head>
 
@@ -34,9 +35,7 @@
                        <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Vielen Dank!</h1>
                </div>
 
-               <div id="menu">
-                       <jsp:include page="static/menu.jsp" flush="true" />
-               </div>
+               <jsp:include page="/static/menu.jsp" flush="true" />
 
                <div id="content_outer">
                        <div id="content_title">
                                        </thead>
                                        <tbody class="table_body">
                                                <%
-                                               // Get iterator from products
-                                               Iterator<Map.Entry<String, Product>> iterator = app.getProductsIterator();
+                                               // Get Iterator
+                                               Iterator<Product> iterator = app.getAvailableProducts();
 
-                                               // Iterate over all
+                                               // "Walk" through all products and unmark them as ordered
                                                while (iterator.hasNext()) {
-                                                       // Get entry
-                                                       Map.Entry<String, Product> entry = iterator.next();
-
-                                                       // Get product
-                                                       Product product = entry.getValue();
-
-                                                       // Mark product as ordered
-                                                       app.markProductAsOrdered(product, session);
+                                                       // Get product instance
+                                                       Product product = iterator.next();
                                                        %>
                                                        <tr>
                                                                <td>
                                                </tr>
 
                                                <tr>
-                                                       <td colspan="5" class="table_header">
+                                                       <td colspan="5" class="table_row">
                                                                <%
-                                                               Iterator<Object> fieldIterator = customer.iterator();
+                                                               // Debug message
+                                                               app.getLogger().debug("customer=" + customer);
+
+                                                               // Get iterator on all fields/attributes
+                                                               Iterator<Map.Entry<Field, Object>> fieldIterator = customer.iterator();
                                                                %>
                                                                <ul>
                                                                <%
                                                                while (fieldIterator.hasNext()) {
-                                                               %>
-                                                                       <li><%=fieldIterator.next()%></li>
-                                                               <%
+                                                                       Map.Entry<Field, Object> entry = fieldIterator.next();
+                                                                       %>
+                                                                       <li><%=entry.getKey().getName()%> set to: <%=entry.getValue()%></li>
+                                                                       <%
                                                                }
                                                                %>
                                                                </ul>
                                                                        out.print("Ihre Bestellung ist eingegangen.");
                                                                        synchronized(session) {
                                                                                //session.invalidate();
+                                                                               out.print("<div>Zu Demo-Zwecken wird die Sitzung nicht gekillt. Bitte 'Bestellung' aufrufen, um zu gucken, dass die Daten da sind.</div>");
                                                                        }
                                                                } else {
                                                                        // Nothing ordered