<!--实现小时-->
<select id="hour" name="hour">
??? <s:bean name="org.apache.struts2.util.Counter" id="counter">?
??? ??? <s:param name="first" value="0" />?
??? ??? <s:param name="last" value="23" />?
??? ??? <s:iterator>?
??? ??? ??? <s:if test="hour == current-1"><option selected="selected"><s:property value="current-1"/></option></s:if>
??? ??? ??? <s:else><option><s:property value="current-1"/></option></s:else>
??? ??? </s:iterator>?
??? </s:bean>
</select>:
<!--实现分钟-->
<select id="minute" name="minute">
??? <s:bean name="org.apache.struts2.util.Counter" id="counter">?
??? ??? <s:param name="first" value="0" />?
??? ??? <s:param name="last" value="59" />?
??? ??? <s:iterator>
??? ??? ??? <s:if test="minute == current-1"><option selected="selected"><s:property value="current-1"/></option></s:if>
??? ??? ??? <s:else><option><s:property value="current-1"/></option></s:else>
??? ??? </s:iterator>?
??? </s:bean>
</select>
注:first属性指定循环起始值,last指定循环终止值,在下面迭代器中输入循环的当前值 current