Home > Enterprise >  th:field parameter syntax using Thymeleaf in Spring
th:field parameter syntax using Thymeleaf in Spring

Time:01-20

I've always seen th:field used like this:

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

but is it possible, in the case I had to search by 2 different fields, to do something like:

th:field="{blabla, thebla}"

CodePudding user response:

Quick answer : No it doesn't permit such a behavior AFAIK. Check the Official doc

A workaround: Your can always send one value with separators..

  •  Tags:  
  • Related