X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=web%2Fform_handler%2Fadd_item.jsp;h=d5638079ca2cd838a98c437aadabca9df38cda5c;hb=8b74c6243b2f46a35037f9e5a6881a0dc8e4844e;hp=aa17cca551f50a208b539a404cbec65dd7ff2b7c;hpb=0ae8f2e28d04dcc5fd14f98c8873e9a95d3f23a7;p=pizzaservice-war.git diff --git a/web/form_handler/add_item.jsp b/web/form_handler/add_item.jsp index aa17cca5..d5638079 100644 --- a/web/form_handler/add_item.jsp +++ b/web/form_handler/add_item.jsp @@ -4,40 +4,56 @@ Author : Roland Haeder --%> +<%@page import="org.mxchange.jcore.BaseFrameworkSystem"%> <%--<%@page errorPage="errorHandler.jsp" %>--%> <%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%> -<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%> +<%@page import="org.mxchange.pizzaapplication.beans.PizzaBean"%> +<%@page import="org.mxchange.pizzaapplication.beans.PizzaServiceBean"%> <%@page import="org.mxchange.pizzaapplication.item.AddableBasketItem"%> - + + + + +<%controller.init();%> + + <% - // Init application instance - PizzaApplication app = PizzaServiceApplication.getInstance(application); - - // Redirect to proper URL - // @TODO Commented out for debugging - //response.sendRedirect(request.getContextPath() + "/?add=1"); + // Get amount from item + Long amount = item.getAmount(); + + // Debug message + BaseFrameworkSystem.getInstance().getLogger().debug("amount=" + amount); + + // Is amount null or zero? + if ((null == amount) || (amount == 0)) { + // Then redirect to added=0 + response.sendRedirect(request.getContextPath() + "/?add=0"); + } else { + // Redirect to proper URL + response.sendRedirect(request.getContextPath() + "/?add=1"); + } %> - - <%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler + Pizza-Service - Form-Handler
-

<%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler

+

Pizza-Service - Form-Handler

- + + +