bean:define定义一个类对象,如何在页面上操作!!!
我想在JSP页上声明一个total对象,它是一个ActionForm,我想用它里的属性做累计,也就是说,total有get/setDayIncome(),get/setDayAdjust()方法;想用这二个setXXX方法做累计,然后在页面下面显示出值来。
可是我这样代码,但我不知道应该怎么给Pay和Sales累加!!!
<bean:define id="total" toScope="page" type="hotel.report.action.ReportActionForm">
<table>
<logic:iterate id="calc" name="calculate" type="hotel.report.action.ReportActionForm" scope="request">
/*****************************
这里怎么利用total做累加!!!!
****************************/
<tr>
<td align="left">
<bean:write name="calc" property="title"/>
</td>
<td align="center">
<bean:write name="calc" property="dayIncome" format="#,###.00"/>
</td>
<td align="center">
<bean:write name="calc" property="dayAdjust" format="#,###.00"/>
</td>
</tr>
</logic:iterate>
<tr>
<th align="center">合计</th>
<td align="center"><bean:write name="total" property="dayIncome"/></td>
<td align="center"><bean:write name="total" property="dayAdjust"/></</td>
</tr>
</table>
请大侠指点!!!!
问题点数:20、回复次数:3Top
1 楼jFresH_MaN(十一月的萧邦-夜曲)回复于 2005-04-03 21:43:37 得分 10
不要用<bean:define>来进行这样的操作
使用<jsp:useBean>和<jsp:setAttributeTop
2 楼SInoyew(天行杨)回复于 2005-04-03 22:07:23 得分 10
用<jsp:useBean>吧!Top
3 楼handysoft(非我不可)回复于 2005-04-03 22:15:17 得分 0
<bean:define id="total" toScope="page" type="hotel.report.action.ReportActionForm">
不可以吗??Top




