title: Access variable in jsp tag files inside a loop?
body: <p>I try to create a jsp tag file, which will call a helper class to print the input object. So I created a file  /WEB-INF/tags/formatter.tag</p>
  
  <pre><code>&lt;%@ tag import="package.Formatter"%&gt;
  &lt;%@ attribute name="value" required="true" type="java.lang.Object" %&gt;              
  &lt;%=Formatter.format(pageContext.getAttribute("value"))%&gt;
  </code></pre>
  
  <p>So that I can call it in JSP like:</p>
  
  <pre><code>&lt;t:formatter value="${obj}" /&gt;
  </code></pre>
  
  <p>But I found that it will not work inside a loop, e.g.</p>
  
  <pre><code>&lt;c:forEach items="${list}" var="i"&gt;
     &lt;t:formatter value="${i.property}"/&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>I suspect that I should not get the attribute from <code>pageContext</code>. But I'm not sure. Any one know about this?</p>