<s:if test="#session.cartitems.size > 0">
<table>
<s:iterator value="#session.cartitems">
<tr id="row_<s:property value="itemid"/>">
<td>
<s:property value="itemName" />
</td>
<td>
<s:property value="listprice" />
</td>
<td>
<s:url id="removeUrl" action="removeItemFromCart">
<s:param name="itemid" value="itemid" />
</s:url>
<s:a href="%{removeUrl}" theme="ajax" targets="basket">Remove</s:a>
<s:a id="a_%{id}" theme="ajax" notifyTopics="/edit">Edit</s:a>
</td>
</tr>
</s:iterator>
</table>
</s:if>
Monday, April 21, 2008
Tuesday, April 1, 2008
Iterating a List Value Struts2
<s:if test=""> 0">
<s:iterator value="#session.categorys">
<li><a href="<s:url action="itemlisthome.action"><s:param name="catalogid" value="#session.catalogs[catalogid-1].id">
<s:param name="categoryid" value="#session.categorys[id-1].id">
</s:url>">
<s:property value="#session.categorys[id-1].name"> </a> </li>
</s:iterator>
</s:if><s:if test="">
</s:if>
Posted by iCehaNgeR's hAcK NoteS at 12:06 PM 0 comments
Struts 2 Tips and Tricks
OGNL treats a character in single-quotes as an actual character, not a String. So this statement will not return your desired result.
<s:if test="%{state=='N'}">
This will work.
<s:if test="%{state=='NE'}">
</s:if>
Posted by iCehaNgeR's hAcK NoteS at 11:54 AM 0 comments
Subscribe to:
Posts (Atom)