你正在寫
Map<String, List<Object>> map = new HashMap<String, List<Object>>();
List<EmployeeDeparment> department = Emp.getEmployeeDepartment(EmployeeId);
List<EmployeeDeparment> department = Emp.getEmployeeDepartment(EmployeeId);
map.put("department", department);
地圖密鑰字符串和值對象的名單,但你作爲價值EmmployeeDeparment
的地圖列表,這樣才能進入工作存儲你NEDD改變,如:
Map<String, List<EmployeeDeparment>> map = new HashMap<String, List<EmployeeDeparment>>();
List<EmployeeDeparment> department = Emp.getEmployeeDepartment(EmployeeId);
List<EmployeeDeparment> department = Emp.getEmployeeDepartment(EmployeeId);
map.put("department", department);
and your remain code...
和
<c:forEach items="${map}" var="m">
<c:forEach items="${map.value}" var="list">
${list.id }
${list.name }
</c:forEach>
</c:forEach>
請你看看我的更新。 – user3214269
如何分別迭代內部列表。 – user3214269
更新了答案。 –