Thymeleaf View

login.html

아래와 같이 필드의 name이 username, password 인 필드를 POST 방식으로 보낸다.

이 예에서는 UserDetails 구현체인 Reader 클래스에 username, password 필드가 있으므로 매칭된다.

...
<form method="POST" th:action="@{/login}">
    <div class="form-group">
        <label for="rd_username">Username</label>
        <input type="text" name="username" id="rd_username" class="form-control" placeholder="Username">
    </div>
    <div class="form-group">
        <label for="rd_password">Password</label>
        <input type="password" name="password" id="rd_password" class="form-control" placeholder="Password">
    </div>
    <div class="text-danger" th:if="${param.error}">
        * Incorrect username or password.
    </div>
    <button type="submit" class="btn btn-secondary">Login</button>
</form>

...

results matching ""

    No results matching ""