How to get Size of list in JSTL

This article shows how to get Size of list using JSP standard tag library (JSTL).

1. Java File

Map<String, Integer> employeeMap = new HashMap<String, Integer>();
employeeMap.put("11-20", 12);
employeeMap.put("21-30", 50);
employeeMap.put("31-40", 3);
request.setAttribute("employeeMap", employeeMap);

2. JSP File

<c:if test="${fn:length(employeeMap) > 1 }">

No comments yet.

Leave a Reply