title: Cannot iterate through HttpSession after going to the controller for 2nd time
body: <p>in my controller i have :</p>
  
  <pre><code>switch(testing){
  case "display" :
          ArrayList&lt;&gt; list = new ArrayList&lt;&gt;();
          list.add(FillData) // string values
          HttpSession test = request.getSession();
          test.setAttribute("testData",list);
          test.setMaxInactiveInterval(50000);
  break;
  case "read" :
         ArrayList&lt;&gt; list2 = new ArrayList&lt;&gt;();
          // some logic
         request.setAttribute("testData",list2);
  break;
  }
  
  RequestDispatcher view = request.getRequestDispatcher("/" + page); // jsp page
  view.forward(request, response);
  </code></pre>
  
  <p>and in my jsp i have like :</p>
  
  <pre><code>&lt;c:choose&gt;
      &lt;!-- this iteration works and sessionScope.testData is not null. --&gt;
     &lt;c:when test="${sessionScope.testData !=null &amp;&amp; requestScope.testData == null&gt;
        &lt;c:forEach items="${sessionScope.testData}" var="elems" varStatus="ctr"&gt;
              &lt;input type="text" value="${lookups}"/&gt;
        &lt;/c:forEach&gt;
     &lt;/c:when&gt;
     &lt;c:otherwise&gt;
  
        &lt;c:forEach items="${requestScope.testData}" var"inputs" varStatus="count"&gt;
                   &lt;!-- this iteration doesnt work and sessionScope.testData is not null when i check it. i've checked if sessionScope.testData is null but it isnt. --&gt;
                   &lt;c:forEach items="${sessionScope.testData}" var="elems" varStatus="ctr"&gt;
                         &lt;input type="text" value="${lookups}"/&gt;
                   &lt;/c:forEach&gt;
        &lt;/c:forEach&gt;
     &lt;/c:otherwise&gt;
  &lt;/c:choose&gt;
  </code></pre>
  
  <p>test case: </p>
  
  <p>when i start my page it goes into the controller with action = "display". and it displays all the values of the session attribute in the jsp. then on my jsp there is a button which calls the controller again passing the action to be = to "read". when it goes back to my jsp. it will go to the <code>&lt;c:otherwise&gt;</code> section and (for example my <code>requestScope.testData</code> has 2 values) it will iterate on the requestScope.testData part. but upon the next <code>&lt;c:forEach&gt;</code> it won't iterate. as mentioned above. i already checked it the session attribute is null, but it isn't. what is possibly wrong here that it won't iterate through the session part? Any help would be much appreciated. Thanks.</p>