The moose likes Struts and the fly likes Struts 2: Iterator/Valuestack question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2: Iterator/Valuestack question." Watch "Struts 2: Iterator/Valuestack question." New topic

Struts 2: Iterator/Valuestack question.

Alia Huss
Ranch Hand

Joined: Feb 13, 2009
Posts: 63

So, I have a jsp 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.

My problem:

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.


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?

David Newton

Joined: Sep 29, 2008
Posts: 12617

Save it with <s:set...>?
Consider Paul's rocket mass heater.
subject: Struts 2: Iterator/Valuestack question.
Similar Threads
Iterating over HaspMap<String,List<Object>> and comparing values.
How to check value in list using s:if
Struts 2 - conditional check of IteratorStatus inside an s:if tag
How to do s:if test of a value in the iterator?
Unable to test property value in <s:if> tag