My problem is I have thymeleaf template for reset password and I want passwords post than json data (actualy post than form data) to my spring boot server. How can I do it?
My rest controller:
@PostMapping(value = "/save-new-password")
public String saveStudent(@Valid @RequestBody NewPasswordDTO newPasswordDTO) {
return "OK";
}
Part from my reset-password-page.html:
<body>
<form th:action="@{/save-new-password}" th:object="${newPasswordDTO}" method="post">
<div class="box">
<h1>RESET PASSWORD</h1>
<input class="password" name="newPassword" type="password" placeholder="New password" th:field="*{newPassword}">
<input class="password" name="confirmPassword" type="password" placeholder="Confirm password" th:field="*{confirmPassword}">
<input class="button" type="submit" value="RESET"/>
</div>
</form>
</body>