Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

How to know if an element of a list belongs to another list using
Struts2 tags?

fergunet

2007-08-13

Replies:


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.
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.