]> git.mxchange.org Git - pizzaservice-war.git/blob - web/form_handler/add_item.jsp
Moved includes in proper sub folders + renamed them according "access group"
[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 errorPage="errorHandler.jsp" %>--%>
8 <%@page contentType="text/html" pageEncoding="UTF-8"%>
9 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
10 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
11 <%@page import="org.mxchange.pizzaapplication.item.AddableBasketItem"%>
12
13 <jsp:useBean id="item" scope="request" class="org.mxchange.pizzaapplication.item.basket.BasketItem" type="AddableBasketItem" />
14 <jsp:setProperty name="item" property="*" />
15
16 <%
17         // Init application instance
18         PizzaApplication app = PizzaServiceApplication.getInstance(application);
19
20         // Get amount from item
21         Long amount = item.getAmount();
22
23         // Debug message
24         app.getLogger().debug("amount=" + amount);
25
26         // Is amount null or zero?
27         if ((amount == null) || (amount == 0)) {
28                 // Then redirect to added=0
29                 response.sendRedirect(request.getContextPath() + "/?add=0");
30         } else {
31                 // Redirect to proper URL
32                 response.sendRedirect(request.getContextPath() + "/?add=1");
33         }
34 %>
35
36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
37 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
38         <head>
39                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
40                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
41                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
42         </head>
43
44         <body>
45                 <div id="title">
46                         <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
47                 </div>
48
49                 <jsp:include page="/static/guest/guest_menu.jsp" flush="false" />
50
51                 <jsp:include page="/static/error/direct_call.jsp" flush="false" />
52
53                 <jsp:include page="/static/guest/guest_footer.jsp" flush="false" />
54         </body>
55 </html>