<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Food Planet - Categories</title>
    </head>
    <body>

    <h1>Food Planet - Categories</h1>
    <hr/>
    
<c:choose>
	<c:when test="${not empty requestScope.catList}">
		<table width="100%" border="1" cellspacing="1" cellpadding="2">
			<tr>
                            <td style="background-color:silver;width:40px"></td>
                            <td style="background-color:silver;"><b>Category</b></td>
			</tr>
			<c:forEach var="c" items="${requestScope.catList}">
                        <tr>
                            <td>
                                ${c.id}
                            </td>
                            <td><a href="../fooditem/list.do?catid=${c.id}">${c.name}</a></td>
                        </tr>
			</c:forEach>
		</table>
	</c:when>
        <c:otherwise>
            <tr><td>No Categories Found!</td></tr>
        </c:otherwise>
</c:choose>

    </body>
</html>
