Spring and Thymeleaf: Sending an object to a controller from a th:each table

前端 未结 3 1556
再見小時候
再見小時候 2021-01-21 18:31

I am making a table of experience data using the th:each attribute with Thymeleaf and my goal is to have a submit button in each row that, when

3条回答
  •  Happy的楠姐
    2021-01-21 18:59

    As @Aeseir's answer, you need to pay attention to the th:object and th:field The field can be int, double, String, List and the object should have getter and setter for its field. In this case

    public class Experience{
         String field;
         List list;
         //getter() and setter()
    }
    

提交回复
热议问题