跨度中未打印总斑点
<s:set var="totalSpots" value="0"/>
<s:iterator var="spotSchedule" value="spotSchedules">
<s:set var="totalSpots" value="#totalSpots + %{spotSchedule.noOfSpots}" />
</s:iterator>
<span style='cursor:pointer;text-decoration:underline;padding-left:5px;color:blue;'>
<s:property value="#totalSpots"/>
</span>
答案 0 :(得分:1)
使用#
符号引用spotSchedule
标记内的<s:iterator>
变量。
<s:set var="totalSpots" value="0"/>
<s:iterator var="spotSchedule" value="spotSchedules">
<s:set var="totalSpots" value="#totalSpots + #spotSchedule.noOfSpots" />
</s:iterator>
<span style='cursor:pointer;text-decoration:underline;padding-left:5px;color:blue;'>
<s:property value="#totalSpots"/>
</span>