title: Using c:forEach over sling:listChildren
body: <p>I have the following code:</p>
  
  <pre><code>&lt;c:set var="res" value="${sling:getResource(resourceResolver, currentPage.path)}" /&gt;
  &lt;sling:listChildren resource="${res}" var="children" /&gt;
  ${children} length ${fn:length(children)}
  &lt;c:forEach var="child" items="${children}"&gt;
       &lt;li&gt;here${child.path}&lt;/li&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>My goal is to spit out the three children of my current page. When I print out <code>${children}</code>, I get an object reference to an iterator (<code>org.apache.sling.resourceresolver.impl.helper.ResourceIteratorDecorator@3b93b521</code>) and the length returns three. The problem is that I cannot get into the loop. According to the <a href="http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html" rel="nofollow">sling taglibs docs</a>, this <code>forEach</code> should be able to handle the iterator object. Is there something I'm missing? The <code>findResources</code> function also returns a <code>ResourceIteratorDecorator</code> when it should be a plain <code>java.util.Iterator</code>.</p>
  
  <p>I did find the <a href="http://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceIteratorDecorator.java" rel="nofollow">ResourceIteratorDecorator class</a> and it extends <code>Iterator&lt;Resource&gt;</code>, so the class itself should not be a problem. Is <code>c:forEach</code> known to have problems with iterator objects?</p>