在jsp页面使用c标签遍历map

后台输出的map集合

{Food [id=1, foodName=麻辣香锅, foodType_id=1, price=100.0, mprice=80.0, 
remark=好辣呀, img=upload/baizhuoxia.jpg, typeName=null, cuisineList=null]=1}

前台页面的遍历map

<c:forEach items="${map }" var="order">
		 <tr height="60">
			<td align="center" width="20%">${order.key.foodName}</td>
			<td align="center" width="20%">¥${order.key.price }</td>
			<td align="center" width="20%">
				<input type="text" value="${order.value }" size="3" lang="3" onblur="alterSorder(this)"/>
			</td>
			<td align="center" width="20%">68.0</td>
			<td align="center" width="20%">
				<input type="button" value="删除" class="btn_next" lang="3" onclick="removeSorder(this)" />
			</td>
		</tr>				
</c:forEach>

显示的页面



猜你喜欢

转载自blog.csdn.net/y_blueblack/article/details/81050121