]> git.mxchange.org Git - pizzaservice-war.git/blob - web/form_handler/add_item.jsp
Continued with project:
[pizzaservice-war.git] / web / form_handler / add_item.jsp
1 <%-- 
2         Document   : add_item
3         Ceated on : Aug 17, 2015, 7:03:38 PM
4         Author     : Roland Haeder
5 --%>
6
7 <%@page import="org.mxchange.jcore.BaseFrameworkSystem"%>
8 <%--<%@page errorPage="errorHandler.jsp" %>--%>
9 <%@page contentType="text/html" pageEncoding="UTF-8"%>
10 <%@page import="org.mxchange.pizzaapplication.beans.PizzaBean"%>
11 <%@page import="org.mxchange.pizzaapplication.beans.PizzaServiceBean"%>
12 <%@page import="org.mxchange.pizzaapplication.item.AddableBasketItem"%>
13
14 <jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.PizzaServiceBean" type="org.mxchange.pizzaapplication.beans.PizzaBean" />
15
16 <jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
17 <jsp:setProperty name="controller" property="basket" value="${basket}" />
18 <%controller.init();%>
19
20 <jsp:useBean id="item" scope="request" class="org.mxchange.pizzaapplication.item.basket.BasketItem" type="AddableBasketItem" />
21 <jsp:setProperty name="item" property="*" />
22
23 <%
24         // Get amount from item
25         Long amount = item.getAmount();
26
27         // Debug message
28         BaseFrameworkSystem.getInstance().getLogger().debug("amount=" + amount);
29
30         // Is amount null or zero?
31         if ((null == amount) || (amount == 0)) {
32                 // Then redirect to added=0
33                 response.sendRedirect(request.getContextPath() + "/?add=0");
34         } else {
35                 // Redirect to proper URL
36                 response.sendRedirect(request.getContextPath() + "/?add=1");
37         }
38 %>
39
40 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
41 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
42         <head>
43                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
44                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
45                 <title>Pizza-Service - Form-Handler</title>
46         </head>
47
48         <body>
49                 <div id="title">
50                         <h1>Pizza-Service - Form-Handler</h1>
51                 </div>
52
53                 <jsp:include page="/static/guest/guest_menu.jsp" flush="false" />
54
55                 <jsp:include page="/static/error/direct_call.jsp" flush="false" />
56
57                 <jsp:include page="/static/guest/guest_footer.jsp" flush="false" />
58         </body>
59 </html>