title: JSF wrap some elements in a list with a div
body: <p>I need to generate some html like this:</p>
  
  <pre><code>&lt;div class='element'&gt;element&lt;/div&gt;
  &lt;div class='element'&gt;element&lt;/div&gt;
  &lt;div class='element'&gt;element&lt;/div&gt;
  &lt;div class='more-elements'&gt;
      &lt;div class='element'&gt;element&lt;/div&gt;
      &lt;div class='element'&gt;element&lt;/div&gt;
      &lt;div class='element'&gt;element&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>basically, the elements after the third must be inside another div tag. I tried this code:</p>
  
  <pre><code>&lt;c:set var="hasMore" value="0"/&gt;
  &lt;c:forEach items="${elements}" var="element" varStatus="loop"&gt;
      &lt;c:if test="${loop.index eq 3}"&gt;
          &lt;c:set var="hasMore" value="1"/&gt;
          &lt;div class='more-elements'&gt;
      &lt;/c:if&gt;
      &lt;div class='element'&gt;${element.name}&lt;/div&gt;
  &lt;/c:forEach&gt;
  &lt;c:if test="{hasMore eq 1}"&gt;
      &lt;/div&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>But then when it tries to render the page I've got an  <code>No end tag found.</code> exception.</p>
  
  <p>What is the proper way to do that?</p>
  
  <p>Thanks.</p>