problem with JSTL <forEach> tag


Web tier: servlets, JSP, Web frameworks: problem with JSTL <forEach> tag

  1. problem with JSTL <forEach> tag (1 messages)

    Hello , Plz go through my code

    <%@ taglib uri="" prefix="c" %>
    <%@ taglib uri="" prefix="c_rt" %>

     for(int i=0; i<userID.size(); i++)

    <jsp:useBean id="list" class="java.util.ArrayList" />
    list = adminBean.getUserID();

    <c_rt:forEach var="userID" items="${list}" begin="0" step="1" end="">
    <option value=" <c_rt:out value="${userID}" />"></option>

    Now I DON'T KNOW HOW TO TERMINATE MY FOR LOOP IN JSTL, I WANT TO REPLACE i<userID.size() into jsp end variable inside <c_rt:forEach > tag.

    Plz help me.
  2. problem with JSTL <forEach> tag[ Go to top ]

    The forEach tag does this automatically. if you simply write the tag as:

    <c:forEach var="userID" items="${list}">
      <option value="<c:out value="${userID}"/>"></option>

    it will automatically start at the beginning of the ${list} collection, step through the items one at a time, and end at the end of the collection.