jsp各种迭代() 变量保存的范围

jsp各种迭代(<c:forEach><ww:iterator>) 变量保存的范围
   一、<c:forEarch>
             

     <c:forEach items="${docList}"var="doc" varStatus="li">

        <tr>

           <td>

              <a href="doc.action?URL=<%=URLEncoder.encode("ID="+((Map)pageContext.getAttribute("doc")).get("ID")) >">${doc.title }</a>

           </td>

        </tr>

      </ c:forEach >

            由此可见,forEarch中变量保存的范围为pageContext

    二、<ww:iterator>
             

      <ww:iterator value="#request['questions']" id="question" status="li">

          <div class="layer_con">

              <ul>

                  <li class="layer_p">

                      <a href="details.action?qstID=<%=((Question)request.getAttribute("question")).getID() %>"></a>

                  </li>

              </ul>

          </div>       

      </ww:iterator>

            webwork是将变量保存在request中的
    三、struts的迭代变量保存在pageContext里

你可能感兴趣的:(jsp各种迭代() 变量保存的范围)