Java Thymeleaf占位符-0而不是字段描述

Java Thymeleaf占位符-0而不是字段描述,java,html,spring-boot,thymeleaf,Java,Html,Spring Boot,Thymeleaf,尝试使用占位符在字段中包含说明 可能有什么问题?您可以尝试以下方法: th:placeholder=“your text”可能重复@damianm为什么要将名字字段绑定到*{salesPrice}。Sales price可能是一个默认值为0的整数。我仅将名字绑定到*{salesPrice}作为示例。但在本例中,您非常接近:D字段是一个“int”。当我将字段改为整数时,它工作得非常好!谢谢! <div class="container"> <form th:acti

尝试使用占位符在字段中包含说明


可能有什么问题?

您可以尝试以下方法:


th:placeholder=“your text”

可能重复@damianm为什么要将名字字段绑定到
*{salesPrice}
。Sales price可能是一个默认值为0的整数。我仅将名字绑定到*{salesPrice}作为示例。但在本例中,您非常接近:D字段是一个“int”。当我将字段改为整数时,它工作得非常好!谢谢!
<div class="container">
    <form th:action="@{/loans/save}" th:object="${loan}" method="POST">
        <input type="text" th:field="*{salesPrice}"
               class="form-control mb-4 col-4" placeholder="First name">
    </form>
</div>