How to iterate Set elements using Struts 2 tags

前端 未结 3 1375
小蘑菇
小蘑菇 2021-01-14 13:56

I have two Sets

set1  contains(\"A\",\"B\",\"C\",\"D\") elements
set2  contains(\"E\",\"F\",\"D\",\"G\") elements

I want to co

3条回答
  •  孤街浪徒
    2021-01-14 14:13

    Rearranged to better list the several ways:

    1. With two Iterators:

      
          
              
                  Common value detected : []
                  
      setOne position : []
      setTwo position : []
    2. With a single Iterator and Set.contains(Object):

      
          
              Common value detected : [] 
    3. With a single Iterator and pure OGNL:

      
          
              Common value detected : [] 
    4. Without Iterators, using OGNL List Selection only (thanks to @AleksandrM for the code):

      
      

提交回复
热议问题