<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/spring" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="loginData" class="hu.nir.nmail.spring.beans.LoginData" scope="request">
    <jsp:setProperty name="loginData" property="*"/>
</jsp:useBean>
<div id="main">
    <form action="login.htm" method="post">
        <table id="login-box" cellspacing="5">
            <tr>
                <td colspan="2" style="text-align: center;">
                    Bejelentkezés
                </td>
            </tr>
            <spring:bind path="loginData.loginName">
            <tr>
                <td><spring:message code="login.account"/></td>
                <td>
                    <input type="text" 
                           name="<c:out value="${status.expression}"/>" 
                           value="<c:out value="${status.value}"/>" />
                </td>
            </tr>
            <tr><td class="error" colspan="2"><c:out value="${status.errorMessage}"/></td></tr>
            </spring:bind>
            <spring:bind path="loginData.password">
            <tr>
                <td><spring:message code="login.password"/></td>
                <td><input type="password" name="<c:out value="${status.expression}"/>"/></td> 
            </tr>
            <tr><td class="error" colspan="2"><c:out value="${status.errorMessage}"/></td></tr>
            </spring:bind>
            <spring:bind path="loginData">
                <c:forEach items="${status.errorMessages}" var="errorMessage">
                    <tr><td class="error" colspan="2"><c:out value="${errorMessage}"/></td></tr>
                </c:forEach>
            </spring:bind>
            <tr>
                <td colspan="2" style="text-align: center;">
                    <input type="submit" value="<spring:message code="login.login"/>" />
                </td>
            </tr>
        </table>
    </form>
</div>
