There is a specific Thymeleaf attribute for that:
<input type="text" id="usernameId" name="username" th:placeholder="#{user.placeholder}" />
It can also be written like this:
<input type="text" id="usernameId" name="username" th:attr="placeholder=#{user.placeholder}" />