%--
Document : index
Created on : 04.08.2015, 10:33:10
Author : Roland Haeder
--%>
<%--<%@page errorPage="errorHandler.jsp" %>--%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Iterator"%>
<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
<%@page import="org.mxchange.pizzaapplication.beans.PizzaBean"%>
<%@page import="org.mxchange.pizzaapplication.product.Product"%>
<%@page import="org.mxchange.pizzaapplication.basket.Basket"%>
<%@page import="org.mxchange.pizzaapplication.item.basket.BasketItem"%>
<%@page import="org.mxchange.pizzaapplication.item.AddableBasketItem"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="basket" uri="http://mxchange.org/pizza-service/tags/basket" %>
<%controller.init();%>
Folgendes kann bestellt werden:
Bestellen?
|
Anzahl:
|
Produkt:
|
Einzelpreis:
|
<%
// Get Iterator
Iterator
iterator = controller.getAvailableProducts();
// "Walk" through all products and unmark them as ordered
while (iterator.hasNext()) {
// Get product instance
Product product = iterator.next();
// Debug message
product.getLogger().debug("product.itemId=" + product.getItemId());
// Create an item instance form this product
AddableBasketItem item = controller.getBasket().getItem(product);
// Debug message
product.getLogger().debug("item=" + item);
// Has it been already added to the basket?
if (item != null) {
// Some nice output ...
%>
Warenkorb
|
<%=item.getAmount()%>
|
<%=product.getTitle()%>
|
<%=product.getPrice()%>
|
<%
// Then skip this item
continue;
}
%>
<%
}
%>