title: Determine size of list in Map<Integer, List<String>> in JSTL <c:if>
body: <p>I have the following map:</p>
  
  <pre><code>Map&lt;Integer, List&lt;String&gt;&gt; namesById= new HashMap&lt;&gt;() ;
  </code></pre>
  
  <p>I want to iterate through the map in jsp. However, first I want to check if the list size is bigger than a certain number first.</p>
  
  <p>So what I want to is this (putting test number for demonstration purposes):</p>
  
  <pre><code>if (namesById.get(1).size() &gt; 3)
  for (String s: namesById.get(1)){
          do something
     }
  </code></pre>
  
  <p>I need to do it in JSP. Since I am a beginner in JSTL I don't exactly know how to write it and it is hard to debug. I tried with this expression:</p>
  
  <pre><code>&lt;c:if test="${fn:length(namesById[1]) gt 3}"
  
  &lt;/c:if&gt;
  </code></pre>
  
  <p>So what I want to do is:</p>
  
  <ol>
  <li>First get the list from the map by giving the specific key</li>
  <li>Then check if the size of the list is bigger a certain number</li>
  <li>And then iterate through the list</li>
  </ol>