iterator within iterator

Joined
Dec 16, 2008
Messages
5
Reaction score
0
for the first iteration of inner loop gives me all values, but for the second iteratoion onwords of outer loop inner loop shows "no data found error" that i have written in itr.hasNext()==false.



</tr>
<%
Iterator itr = (Iterator)request.getAttribute("getByAll");
if( itr.hasNext()==false){%>
<font color="#CC3333">No data found
</font>web_category_id
<%}else
while(itr.hasNext()){
WebProfileDetailsBean bean1 = (WebProfileDetailsBean )itr.next();
%>

<tr>

<td width="255"> <%=bean1.getWeb_category_id() %> </td>
<td width="255"> <%=bean1.getProfile_id() %> </td>
<% int pid=bean1.getProfile_id() ;
System.out.println(pid);
%>

<%

Iterator itr1 = (Iterator)request.getAttribute("getByAll1");
if( itr1.hasNext()==false){%>
<font color="#CC3333">No data found
</font>web_category_id
<%}else
while(itr1.hasNext()){
int flag=0;
WebCategoryBean bean2 = (WebCategoryBean)itr1.next();


%>
<td width="255"> <%=bean2.getWeb_category_name() %> </td>
<% }
%>

</tr>
<%
} %>

</table>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top