【发布时间】:2021-09-23 14:21:08
【问题描述】:
在 Thymeleaf (spring-boot-starter-thymeleaf) 当前版本中使用 Spring。当我有一个某些字段为空的表单时,Thymeleaf 在输入控件中显示为空。如何让它只显示空白?
只有在我使用 fetch 和 replace div 时才会发生这种情况。如果我从 URL 打开一个窗口,则内容很好。发生了什么事?
TIA
<label for="address1">Address:</label>
<input type="text" name="address1" id="address1" th:field="*{address1}"> <br>
<label for="address2"> </label>
<input type="text" name="address2" id="address2" th:field="*{address2}"> <br>
【问题讨论】:
标签: thymeleaf