【发布时间】:2018-06-08 09:36:42
【问题描述】:
我想使用表单验证重置密码输入。我将 Spring Boot 与 Hibernate 和 Thymeleaf 一起使用。
问题:HTML 表单 POST 函数不调用 Spring POST 控制器。 我尝试通过添加记录器来测试它,但它们不会被调用。 当我输入新密码并提交时,页面会自动返回登录页面。
HTML:
<body class="login login-background">
<div id="wrap">
<div id="main" class="container clear-top">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form th:action="@{/resetPassword}"
th:object="${resetPasswordForm}" method="POST">
<input id="password" type="password"/>
<input type="hidden" th:name="${_csrf.parameterName}"
th:value="${_csrf.token}"/>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
我已经尝试了 2 天来查找问题,但我似乎无法弄清楚。我希望有人可以帮助我。谢谢!
【问题讨论】:
标签: spring hibernate spring-boot thymeleaf