I am trying to get an html page like http://jsbin.com/awoco
This is a JSP page so it will include scriptlet. Final html will be kind of like this (i left tags unclosed to save space):
<%
Iterator it = MyList.iterator()
While (it.hasNext())
SomeClass all = it.next();
SomeClass a = it.next();
SomeClass b = it.next();
%>
<tr>
<td rowspan=3 valign=top>Red<td><%=all.Name()%><td><%=all.price()%><td><%=all.originalPrice()%>
</tr>
<tr>
<td><%=a.Name()%><td><%=a.price()%><td><%=a.originalPrice()%>
</tr>
<tr >
<td><%=b.Name()%><td><%=b.price()%><td><%=b.originalPrice()%>
</tr>
As you can see, I have to call next 3 times inside the while loop because the List that I getting with the data is populated that way and I have to show the data in exact same way as the link provided above.
Is there a way to change the html somehow so that I dont have to call next more than once but still get the same table structure.
...If you want to know why I dont want to call next more than once then please see the edit :)