title: Retrieving the first element of a TreeMap using JSTL/EL/JAVA
body: <p>I am trying to access the first element of a TreeMap, I have the following HTML in a JSP file:</p>
  
  <pre><code>&lt;c:forEach items="${subscriber.depent}" var="entry" begin="0" end="0" step="1"&gt;
      &lt;c:set var="dep" value="${entry.value}" /&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>This code gets me the first element of the TreeMap but this just seems like a 'hack' to me.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>&lt;c:set var="dep" value="${subscriber.depent[0]}" /&gt;
  </code></pre>
  
  <p>But that gives me a exception: <blockquote>java.lang.Integer incompatible with java.lang.Long</blockquote></p>
  
  <p>Any better ways of doing this?</p>
  
  <p>Thanks, Randall.</p>