<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% request.setAttribute("title", "User List"); %>
<%@ include file="head.jsp" %>
<body>
<h1>${sessionScope.get("user")}</h1>
<c:if test="${empty userlist}">
    <p>There are no users registered (and you managed to login somehow???).</p>
</c:if>
<c:if test="${not empty userlist}">
<table>
    <p><a href="${pageContext.request.contextPath}/bootcamps">Bootcamps</a></p>
    <thead>
        <td>Name</td><td>Email</td>
    </thead>
    <c:forEach var="user" items="${userlist}">
        <tr>
            <td>${user.name}</td>
            <td>${user.email}</td>
        </tr>
    </c:forEach>
</table>
</c:if>
<%@ include file="foot.jsp" %>

