struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fergunet <>
Subject How to know if an element of a list belongs to another list using Struts2 tags?
Date Mon, 13 Aug 2007 11:06:08 GMT

Hi all! I'm iterating over two list, and I need to shown if an element of the
second list belongs to the first.

Something like that:

iterator list1
  print list1.actualElement.attributes...
  iterator list2
     if list2.element ==  list1.actualElement
         print "yes"
         print "no"

The problem is that I only want to print ONE "yes" or "not" not all of them.
It exists any tag like <s:belongs value="myList" element="theElement"> or
something? Or I should create an external variable "_belongs"  and set to
true if the element is found (like the standard search procedure we learnt
years ago when we were rookies in programming ; )

Thank you in advance, and like always, sorry about my English.
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message