【发布时间】:2020-06-20 19:17:04
【问题描述】:
我正在创建一个简单的 HTML 表单以及我在 Spring Boot 应用程序中使用的 Thymelaf。
我在表格中指定了以下语句:
<input type="number" step="0.1" min="0" max="10" **th:field="*{rating}"**
class="form-control mb-4 col-4" placeholder="Rating">
但是,表单中显示的值不是 Rating,而是 0。
删除 0 后,占位符终于出现了。
编辑
显然,Thymeleaf 似乎在这里引起了问题。
<input type="number" step="0.1" min="0" max="10" th:field="*{rating}"
class="form-control mb-4 col-4" placeholder="Rating">
<input type="number" placeholder="Test Rating"
class="form-control mb-4 col-4">
【问题讨论】:
标签: html spring-boot spring-mvc bootstrap-4 thymeleaf