This week's book giveaway is in the
We're giving away four copies of
and have Sam Newman on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Struts 2: Iterator/Valuestack question.
Joined: Feb 13, 2009
Mar 11, 2009 07:58:34
So, I have a
with an iterator. The iterator iterates through a List of ReservationBeans.
Each bean contains a couple of values, the date of the reservation is one of them.
The list contains several ReservationBeans, some of the beans have the same date value.
Ex. There are two ReservationsBeans where the value of date is "2009-03-03".
If the iterator has already iterated a ReservationBean with the same date as the current ReservationBean I want it to ignore further instructions. This would be done with an <s:if> tag.
<s:iterator value="res"> <s:if test="the current date != the previous date"> //Do something. </s:if> </s:iterator>
So my question is, is there a way of collecting the date value of the previous ReservationBean from the value stack?
Or do you have any other clever ideas on how this could be achieved?
Joined: Sep 29, 2008
Mar 11, 2009 09:24:04
Save it with <s:set...>?
Have you checked out
subject: Struts 2: Iterator/Valuestack question.
How to do s:if test of a value in the iterator?
How to check value in list using s:if
Unable to test property value in <s:if> tag
Struts 2 - conditional check of IteratorStatus inside an s:if tag
Iterating over HaspMap<String,List<Object>> and comparing values.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015