0
@ModelAttribute(value = "tempmap")
    public Map<Integer, String> getETypeMap(HttpServletRequest request)
            throws EmployeeBusinessException {
        Map<Integer, String> tempmap = employeeBS
                .fetchEmployeementType(userDetails.getTenantId(), userDetails.getLocaleId());
        return tempmap;
    }

here i have tempmap ie HashMap type of object, the problem is i want to use this oblect in my jsp file using SpringMVC framework.

Piyush Mittal
  • 1,860
  • 1
  • 21
  • 39

1 Answers1

0

use JSTL forEach loop for iterating your map as follows:

 <c:forEach var="tempmap" items="${tempmap}">
   Key: ${tempmap.key}  - Value: ${tempmap.value}
 </c:forEach>

Hope it will help you.. use this link for more details about jstl Enabling JavaServerPages Standard Tag Library (JSTL) in JSP

Community
  • 1
  • 1
Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73