2012年7月19日木曜日

struts2 タグ iteratorの中、if testで比較


do s:if test of a value in the iterator


<select name="product">
<s:iterator value="#session.productList" >
<s:if test="%{selected_code == code}">
<option value="<s:property value='code'/>" selected="selected"><s:property value='name'/></option>
</s:if>
<s:else>
<option value="<s:property value=' code '/>"><s:property value=' name '/></option>
</s:else>
</s:iterator>
</select>

0 件のコメント:

コメントを投稿