【发布时间】:2015-12-28 06:02:23
【问题描述】:
模型有 Map(String,Integer),此地图显示在页面上的复选框中,例如:
<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>
我应该如何提交复选框状态更改?
【问题讨论】:
-
我相信您需要一个包装器对象来保存提交的数据,如下所示:stackoverflow.com/a/36522177/3416320
标签: java html spring-mvc servlets thymeleaf