struts 2 三目运算

<s:set id="styleList" value="{'default','success','warning'}"/>

<s:iterator id="student" value="#request.studentList" status="st">

<tr class='<s:property value="#st.index%3==0?#styleList[0]:#st.index%3==1?#styleList[1]:#styleList[2]" />'>

</tr>
</s:iterator>

posted @ 2014-05-26 09:43  smile_tina  阅读(284)  评论(0编辑  收藏  举报