On Saturday 25 April 2009 10:20:43 am Bhaarat Sharma wrote: > is there no way to overcome this drawback? > > do i have to change the way I am getting my results from the DB to suit the > iterator tags drawback in this case?
You call it a drawback, I call it a feature... I don't know if I'd want to have 3 'next()' calls for every one 'hasNext()' call. It might work now, but you're asking for some maintainer after you to curse your name. This is likely to introduce a problem later. I assume you're doing this to change the display logic, maybe making 3 columns instead of one, etc. I would look for a way to either 1) split into three lists that you can cleanly iterate over 2) try to use HTML/CSS/JS/Whatever to display what you want without introducing programming logic. I would be interested to know why you want 3 VOs with each iteration, this would probably help us to give you better advice. -Wes > > On Fri, Apr 24, 2009 at 5:25 PM, Bhaarat Sharma <bhaara...@gmail.com> wrote: > > I have the following code in jsp scriplet > > <% > > ArrayList statisticsList = something.getStatistics(); > > Iterator itr1 = statisticsList.iterator(); > > > > while (itr1.hasNext()) > > { > > dvo3_a = (VerificationVO) itr1.next(); > > dvo3_b = (VerificationVO) itr1.next(); > > dvo3_c = (VerificationVO) itr1.next(); > > %> > > > > then in the html I am using the three objects dvo3_a, dvo3_b and dvo3_c > > > > while converting this to struts2 tags I've done this > > > > <s:iterator value = "statistics"> > > ... > > ... > > .... > > </s:iterator> > > > > how can i use the three objects as created above inside this struts2 html > > tag? is there a way to get something AFTER the current element, while > > still under the iterator tag? > > > > this is that itr1.next() statement does. it moves the cursor one element > > next. > > > > Thanks! -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org