一: Iterator迭代时获取下标。
例如:<s:iterator id="obj" value="list" status="index">
<!---输出当前元素的属性-->
<s:property value="property"/>
<!---输出当前迭代元素的索引-->
<s:property value="#index.index"/>
<!---输出当前迭代了几个元素-->
<s:property value="#index.count"/>
<!---返回当前迭代元素的索引是否为奇数-->
<s:property value="#index.odd"/>
<!---返回当前迭代元素的索引是否为偶数-->
<s:property value="#index.event"/>
<!---返回当前元素是否为第一个-->
<s:property value="#index.first"/>
<!---返回当前元素是否为最后一个-->
<s:property value="#index.last"/>
<!---返回当前元素下标-->
<s:property value="#index.getCount()" />
二:判断list是否为空。
方式1:
<s:if test="#ziyuan.user.ziyuans.size()>2">
长度大于2...的操作
</s:if>
<s:else>
...小于2的操作
</s:else>
方式2:
<s:if test="#ziyuan.bagInfos.isEmpty()">
...为空
</s:if>
<s:else>
...不为空
</s:else>
三、获取url中的参数
<!--<s:property value="#parameters.categoryType[0]"/>-->
<s:if test='#parameters.categoryType[0]=="2"'>
<a href="javascript:void(0)" class="easyui-linkbutton" id="selectStudyArticleCategory">选择文章类目</a>${category.cname }
</s:if>
<s:if test='#parameters.categoryType[0]=="3"'>
<a href="javascript:void(0)" class="easyui-linkbutton" id="selectJobArticleCategory">选择文章类目</a>${category.cname }
</s:if>