3 Ceated on : Aug 17, 2015, 7:03:38 PM
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page contentType="text/html" pageEncoding="UTF-8"%>
9 <%@page import="org.mxchange.pizzaapplication.beans.PizzaBean"%>
10 <%@page import="org.mxchange.pizzaapplication.beans.PizzaServiceBean"%>
11 <%@page import="org.mxchange.pizzaapplication.item.AddableBasketItem"%>
13 <jsp:useBean id="item" scope="request" class="org.mxchange.pizzaapplication.item.basket.BasketItem" type="AddableBasketItem" />
14 <jsp:setProperty name="item" property="*" />
17 // Init application instance
18 PizzaBean app = PizzaServiceBean.getInstance(application);
20 // Get amount from item
21 Long amount = item.getAmount();
24 app.getLogger().debug("amount=" + amount);
26 // Is amount null or zero?
27 if ((null == amount) || (amount == 0)) {
28 // Then redirect to added=0
29 response.sendRedirect(request.getContextPath() + "/?add=0");
31 // Redirect to proper URL
32 response.sendRedirect(request.getContextPath() + "/?add=1");
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">
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>Pizza-Service - Form-Handler</title>
46 <h1>Pizza-Service - Form-Handler</h1>
49 <jsp:include page="/static/guest/guest_menu.jsp" flush="false" />
51 <jsp:include page="/static/error/direct_call.jsp" flush="false" />
53 <jsp:include page="/static/guest/guest_footer.jsp" flush="false" />