]> git.mxchange.org Git - pizzaservice-war.git/blob - web/form_handler/do_preview.jsp
handleChooseFromRequestSession() can be made private
[pizzaservice-war.git] / web / form_handler / do_preview.jsp
1 <%-- 
2         Document   : order
3         Created on : 04.08.2015, 10:55:10
4         Author     : Roland Haeder
5 --%>
6
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"%>
16
17 <%
18         // Init application instance
19         PizzaApplication app = PizzaServiceApplication.getInstance(application);
20
21         // Is it post?
22         if ("POST".equals(request.getMethod())) { //NOI18N
23                 // "Walk" through all products and unmark them as ordered
24                 for (final Product product : app.getUnmarkedProducts(session)) {
25                         // Is it choosen and amount set?
26                         if (app.isProductChoosen(product, request, session)) {
27                                 // Then mark it as choosen
28                                 app.markProductAsChoosen(product, session);
29                         } else {
30                                 // Unmark it
31                                 app.unmarkProductAsChoosen(product, session);
32                                 app.unmarkProductAsOrdered(product, session);
33                         }
34                 }
35                 // Redirect to proper URL
36                 // @TODO Commented out for developing:
37                 //response.sendRedirect(request.getContextPath() + "/finished.jsp");
38 %>
39 <jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
40 <jsp:setProperty name="customer" property="*" />
41 <jsp:forward page="../preview.jsp" />
42 <%
43         }
44 %>
45 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
46 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
47         <head>
48                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
49                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
50                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
51         </head>
52
53         <body>
54                 <div id="title">
55                         <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
56                 </div>
57
58                 <jsp:include page="/static/menu.jsp" flush="true" />
59
60                 <div id="content_outer">
61                         <div id="content_title">
62                                 <h2>Bitte nicht direkt aufrufen:</h2>
63                         </div>
64
65                         <div id="content">
66                                 Bitte rufen Sie diese Seite nicht direkt auf.
67                         </div>
68                 </div>
69         </body>
70 </html>