模型圖(字符串,整數),該地圖在像複選框頁面上顯示:提交地圖<字符串,整數> Thymeleaf
<ul>
<li th:each="item : ${map}">
<input type="checkbox" th:checked="${item.value} == 1" th:id="${item.key}"/>
<label th:for="${item.key}" th:text="${item.key}"/>
</li>
</ul>
我應該如何提交複選框狀態變化?
我相信你需要一個包裝對象來保存提交的數據,就像這樣:http://stackoverflow.com/a/36522177/3416320 – bpgriner