- // 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");
+ }