3 Created on : 04.08.2015, 10:55:10
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page import="java.util.Iterator"%>
9 <%@page import="java.util.Map"%>
10 <%@page import="org.mxchange.jcore.contact.Gender"%>
11 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
12 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
13 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
14 <%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
15 <%@page contentType="text/html" pageEncoding="UTF-8"%>
18 // Init application instance
19 PizzaApplication app = PizzaServiceApplication.getInstance(application);
22 if ("POST".equals(request.getMethod())) { //NOI18N
24 Iterator<Product> iterator = app.getAvailableProducts();
26 // "Walk" through all products and unmark them as ordered
27 while (iterator.hasNext()) {
28 // Get product instance
29 Product product = iterator.next();
31 // Mark product as not ordered
32 app.unmarkProductAsOrdered(product, session);
34 // Is it choosen and amount set?
35 if (app.isProductChoosen(product, request, session)) {
36 // Then mark it as choosen
37 app.markProductAsChoosen(product, session);
40 app.unmarkProductAsChoosen(product, session);
44 // Redirect to proper URL
45 // @TODO Commented out for developing:
46 //response.sendRedirect(request.getContextPath() + "/finished.jsp");
48 <jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
49 <jsp:setProperty name="customer" property="*" />
50 <jsp:forward page="../preview.jsp" />
54 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
55 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
57 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
58 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
59 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
64 <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
67 <jsp:include page="/static/menu.jsp" flush="true" />
69 <jsp:include page="/static/error/direct_call.jsp" flush="true" />