thymeleaf 遍历List<Map>回显复选框

1.说明:和普通的pojo类一样。只不过将点${user.id}换成了${user['id']}
2.实例(brandList即为List,b即为Map<String,Object>)

<option th:selected="${goods.brandId eq b['id']}" th:each="b:${brandList}" th:value="${b['id']}" th:text="${b['abc']}+'--'+${b['name']}" value="1">耐克</option>
注意:brandList即为List,b即为Map<String,Object>,id、name、abc均为Map中的key

猜你喜欢

转载自blog.csdn.net/lei_da_gou/article/details/80839005
今日推荐