Caroline,
Iterator iterator = threadRows.iterator();
while( iterator.hasNext() ) {
odd = ( odd + 1 )%2;
ThreadBean threadBean = ( ThreadBean
)iterator.next();
..... } %>
5. when I tried to write out the properties; for example:
<%=threadBean.getSender()%> <%=threadBean.getThreadReplyCount()%> <%=threadBean.getThreadViewCount()%>
Are you trying to print these inside of the above loop, where the "...." is? Or, are you trying to do this somewhere outside the loop?
I highly recommend against using scriptlets. Since you're already using Struts, why not use the rich set of tags available, like logic:iterate, etc.?
On a completely unrelated subject, this:
boolean odd = false; for(..) { odd = !odd; }
is much more efficient than
int odd = 0; for(..) { odd = (odd + 1) % 2; }
Plus, it's a bit more strightforward, which is more important than raw speed.
-chris
signature.asc
Description: OpenPGP digital signature