struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fergunet <fergu...@hotmail.com>
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"
     else
         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: http://www.nabble.com/How-to-know-if-an-element-of-a-list-belongs-to-another-list-using-Struts2-tags--tf4260538.html#a12124300
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message