【问题标题】:thymeleaf hw to fill th:field value with model attibutethymeleaf 如何用模型属性填充 th:field 值
【发布时间】:2020-08-09 21:40:49
【问题描述】:
<input type="hidden" id="customerid" th:value="${id}" th:field="*{customer.id}">

id 是模型属性。我想将它存储为 customer.id

【问题讨论】:

    标签: database spring-boot thymeleaf


    【解决方案1】:

    如果使用 th:field,则不应指定 th:value 和 id :

    <input type="hidden"  th:field="*{customer.id}">
    

    来源:https://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html#inputs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多