我下面的代码不正确,请帮我修改一下,谢谢了!
   <s:iterator value="{'美国','中国','日本','德国','法国'}" id="country" status="st" >
  <s:if test="#st.odd">style="color:red"</s:if>
    <s:property value="country" />      
   </s:iterator>

解决方案 »

  1.   

    <s:iterator value="{'美国','中国','日本','德国','法国'}" id="country" status="st" >
      <s:if test="#st.index%2==0">style="color:red"</s:if>
      <s:property value="country" />  
      </s:iterator>
      

  2.   

    <s:iterator value="{'美国','中国','日本','德国','法国'}" id="country" status="index" >
      <s:if test="#index.odd==true">style="color:red"</s:if>
      <s:property value="country" />   
      </s:iterator>
      

  3.   

    <s:iterator value="{'美国','中国','日本','德国','法国'}" id="country" status="st" >
      <font color='<s:if test="#st.odd">red</s:if>' >
          <s:property value="country" />   
      </font>
      </s:iterator>