<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="org.academiadecodigo.enuminatti.helloworldspringmvc.utils.Attributes" %>

<html>
<head>
    <title>Login Form</title>
</head>
<body>
<form:form method="post" modelAttribute="${Attributes.USER}">
    <p>Name: <form:input path="username"/></p>
    <p><form:errors path="username" cssClass="error"/></p>
    <p>Password: <form:password path="password"/></p>
    <p><form:errors path="password" cssClass="error"/></p>
    <input type="submit" value="Login"/>
</form:form>
<c:if test="${not empty requestScope[Attributes.AUTH_FAILURE]}">
    <div style="color:red">${requestScope[Attributes.AUTH_FAILURE]}</div>
</c:if>
</body>
</html>
