I wouldn't put Java in my HTML any more than I would use println statements in a Servlet to generate HTML. Scriplets are dead and should be left to rest in peace.
If you can't find a way to do what you need with either the JSTL or Struts taglibs, I would suggest writing your own custom tag, it's fairly straightforward and totally reusable (unlike a Scriplet). (*Chris*) On Fri, May 29, 2009 at 10:33 PM, Bhaarat Sharma <bhaara...@gmail.com>wrote: > so if there is a need to do something like this ...we are better off using > good ole scritplets? <% %> > > On Sat, May 30, 2009 at 12:25 AM, Dave Newton <newton.d...@yahoo.com> > wrote: > > > Bhaarat Sharma wrote: > > > >> Iterator it = myList.iterator() > >> while (it.hasNext()) { > >> SomeClass ob1 = (SomeClass) it.next(); > >> SomeClass ob2 = (SomeClass) it.next(); > >> //do something > >> } > >> > >> why can we not achieve the same with s:iterator tag. > >> What was the reasoning behind not providing a 'next' or something > similar? > >> > > > > Because it's a simple iterator, just like Java's for (Type var : > > collection) construct or JSTL's forEach tag. > > > > Dave > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > >