【问题标题】:th:field parameter syntax using Thymeleaf in Springth:field 参数语法在 Spring 中使用 Thymeleaf
【发布时间】:2022-01-18 14:51:54
【问题描述】:

我总是看到 th:field 是这样使用的:

<form th:object="${bla}" method="POST">
   <div>
       <label for="bla"> </label>
       <input type="text" th:field="*{blabla}">
       <input type="submit" value="Search">
   </div>
</form>

但是,如果我必须通过 2 个不同的字段进行搜索,是否可以执行以下操作:

th:field="{blabla, thebla}"

【问题讨论】:

    标签: html spring-boot thymeleaf


    【解决方案1】:

    快速回答: AFAIK 不允许这种行为。 检查Official doc

    一种解决方法:您始终可以使用分隔符发送一个值..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-06
      • 1970-01-01
      • 2013-12-20
      • 2015-03-07
      • 1970-01-01
      • 1970-01-01
      • 2019-03-22
      • 1970-01-01
      相关资源
      最近更新 更多