<s:set var="total" value="0" /><!-- define a variable--> <s:iterator value = "{1, 2, 3, 4}" var="list" > ${list} + <s:set var ="total" value="#list+#total" /><!-- Sum the values of list--> </s:iterator> <br>= <s:property value="#total"/> <!-- output the calculated value of total --> https://zhidao.baidu.com/question/385729582.html