4.9 登录&拦截器
1.登录:
1)、login.html
<form class="form-signin" action="dashboard.html" th:action="@{user/login}", method="post">
<!-- 登陆错误消息的显示 判断errorMsg是否为空 -->
<p style="color: red" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></p>
<input type="text" name="username" class="form-control" placeholder="Username" th:placeholder="#{login.username}" required="" autofocus="">
<input type="password" name = "password" class="form-control" placeholder="Password" th:placeholder="#{login.password}"required="">
2)、LoginController
@Controlle