@ModelAttribute(value = "tempmap")
public Map<Integer, String> getETypeMap(HttpServletRequest request)
throws EmployeeBusinessException {
Map<Integer, String> tempmap = employeeBS
.fetchEmployeementType(userDetails.getTenantId(), userDetails.getLocaleId());
return tempmap;
}这里我有HashMap类型的对象,问题是我想使用SpringMVC框架在jsp文件中使用这个oblect。
发布于 2015-07-02 06:47:34
使用JSTL forEach循环来迭代您的地图,如下所示:
<c:forEach var="tempmap" items="${tempmap}">
Key: ${tempmap.key} - Value: ${tempmap.value}
</c:forEach>希望它能帮到你..。有关jstl Enabling JavaServerPages Standard Tag Library (JSTL) in JSP的详细信息,请使用此链接
https://stackoverflow.com/questions/31176095
复制相似问题