struts2 - calculate in struts 2 tag? -
i have iterate , want calculate sum of values :
<s:iterator value="myvalues" status="mystatus"> <s:property value="value" /> </s:iterator> <s:property value="total.here" />
i want show sum of "value" in "total.here". sorry bad english. thank much.
assuming myvalues array or list of integral values accessible action:
<s:set var="total" value="%{0}" /> <s:iterator value="myvalues"> <s:set var="total" value="%{top + #attr.total}" /> </s:iterator> <s:property value="%{'' + #attr.total}" />
Comments
Post a Comment