我有两个Set
s
set1 contains("A","B","C","D") elements
set2 contains("E","F","D","G") elements
我想将 set1
的每个元素与 set2
的每个元素进行比较,并使用 Struts2 标签显示匹配的元素.
I want to compare every element of set1
with every element of set2
and display matched elements using Struts2 tags.
试试下面的代码:
<s:iterator var="val1" value="set1">
<s:iterator var="val2" value="set2">
<s:if test="#val1 == #val2">
<s:property /><br>
</s:if>
</s:iterator>
</s:iterator>
这篇关于如何使用 Struts 2 标签迭代 Set 元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!