springboot-Thymeleaf语法取值
报错:2020-07-22 23:24:19.447 ERROR 7296 --- [nio-8080-exec-8] org.thymeleaf.TemplateEngine : THYMELEAF Exception processing template "front/cart": Exception evaluating SpringEL expression: "item.num" (template: "front/cart" - line 101, col 44)
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "item.num" (template: "front/cart" - line 101, col 44)
<table class="table table-hover table-striped table-bordered">
<tr>
<th>
<input type="checkbox" id="all">全选</th>
<th>序号</th>
<th>商品名称</th>
<th>商品图片</th>
<th>商品数量</th>
<th>商品总价</th>
<th>操作</th>
</tr>
<tr th:each="item,i:${session.cart}">
<td>
<input type="checkbox">
</td>
<td>[[${i.index+1}]]</td>
<td></td>
<td> <img th:src="${item.value.product.image}" alt="" width="60" height="60"></td>
<td>
<input type="text" th:value="${item.num}" size="5">
</td>
<td>[[${item.value.price}]]</td>
<td>
<button class="btn btn-success" type="button"> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>修改</button>
<button class="btn btn-danger" type="button" onclick="javaScript:return confirm('是否确认删除');">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
</button>
</td>
</tr>
<tr>
<td colspan="7" align="right">
<button class="btn btn-warning margin-right-15" type="button" > 删除选中项</button>
<button class="btn btn-warning margin-right-15" type="button" > 清空购物车</button>
<button class="btn btn-warning margin-right-15" type="button" > 继续购物</button>
<a href="order.html"><button class="btn btn-warning " type="button" > 结算</button></a>
</td>
</tr>
<tr>
<td colspan="7" align="right" class="foot-msg">
总计: <b><span>1000</span> </b>元
</td>
</tr>
</table>
cart是放在session作用域的Map集合,在Thymeleaf取值时应该时item.value.num