Hello , Plz go through my code
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core_rt" 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>
</c_rt:forEach>
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.
Ciao
RD
-
problem with JSTL <forEach> tag (1 messages)
- Posted by: Ranendra Das
- Posted on: August 03 2005 01:52 EDT
Threaded Messages (1)
- problem with JSTL <forEach> tag by Ray Baco on August 03 2005 10:33 EDT
-
problem with JSTL <forEach> tag[ Go to top ]
- Posted by: Ray Baco
- Posted on: August 03 2005 10:33 EDT
- in response to Ranendra Das
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>
</c:forEach>
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.