Итак, у меня есть это в моем html:
<html xmlns:th="http://www.thymeleaf.org">
<body>
<form th:action="@{/user/set-new-password}" method="post">
<input type="password" name="password" placeholder="Password">
<input type="password" name="matchesPassword" placeholder="Password">
<input type="hidden" th:value="${token}" th:text="${token}">
<input type="submit" class="submit-button" th:value="#{changePassword.submitButton}"/>
</form>
</body>
</html>
Контроллер:
@GetMapping(value = "/set-new-password")
public String changePasswordForm(Model model, @ModelAttribute("token") String token) {
model.addAttribute("token", token);
return "relatedToUserAccounts/change-password";
}
HTML выглядит так
<input type="hidden" value=""></input>
Я хочу выглядеть так, если token = "abcd1234"
<input type="hidden" value="abcd1234"></input>
Для th: text это работает, и html показывает текст, но th: значение остается пустым.