title: How to access to iteration variable in c:forEach with a scriptlet/expression?
body: <p><strong>var</strong> is a static attribute to expose the current element (local to the body) </p>
  
  <p>How to acces to var attribute through scriptlet/expression? </p>
  
  <p><strong>Initialization code</strong></p>
  
  <pre><code>&lt;% 
  Employee e = new Employee();
  e.setName("name");
  e.setEmail("abc@gmail.com");
  java.util.List&lt;Employee&gt; empList = new java.util.ArrayList();
  empList.add(e);
  request.setAttribute("empList", empList); %&gt;
  </code></pre>
  
  <p><strong>forEach code 1</strong> deferredExpression Error</p>
  
  <pre><code>&lt;c:forEach var="emp" items="${employees}"&gt;
    &lt;c:out value="${emp.name}"/&gt;&lt;br&gt;&lt;%=emp.getName()%&gt; 
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p><strong>NOR</strong></p>
  
  <p><strong>forEach code 2</strong> deferredExpression Error</p>
  
  <pre><code>&lt;c:forEach var="emp" items="${empList}" varStatus="status"&gt;
    Emp email: &lt;%= ((Employee)(pageContext.findAttribute("emp"))).getName() %&gt;
  &lt;/c:forEach&gt;
  </code></pre>