How to get Item-Quantity map using Spring MVC forms?
Solution 1:
I don't know what dishList
is, but if it has an id
field then the code for your form would look something like:
<form action="#" th:action="@{/greeting}" th:object="${Order}" method="post">
<span th:each="dish : ${dishList}">
<input th:field="*{dishQuantityMap[__${dish.id}__]}" type="number" />
</span>
</form>