<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Create an account</title>
</head>
<body>
<h1>Welcome to httpunit example registration</h1>
<div class="container">
    <form:form method="POST" commandName="registrationForm" action="registrationSubmit">
        <spring:bind path="name">
                <form:input type="text" path="name"></form:input>
        </spring:bind>

        <spring:bind path="gender">
                <form:select path="gender" >
                 <c:forEach items="${genderList}" var="gender">
                 <c:choose>
					<c:when test="${registrationForm.gender eq gender}">
					<option value="${gender}" selected ="selected"><c:out value="${gender}"/></option>
					</c:when>
					<c:otherwise>
					<option value="${gender}"><c:out value="${gender}" /></option>
					</c:otherwise>
					</c:choose>
                 </c:forEach>
                 </form:select>
        </spring:bind>

       <spring:bind path="countryId">
                <form:select path="countryId" items="${countryList}" />
        </spring:bind>

        <button type="submit">Submit</button>
    </form:form>

</div>
</body>
</html>