AcrionForm的数组属性在显示层的用法
-----------------------------------------------------------------------------------------
我如果不用一般的bean而是用formbean,而且frombean有2个数组或者ArrayList(name1,name2)的属性,我在jsp里面画table时应该怎么做呢?
table样式:
name1 name2
value11 value21
value12 value22
...
我能实现的只是:
name1 name2
value11 value12 ... value21 value22 ...
假设VestForm 有两个数组属性start和end.
<%
com.guoan.cps.form.VestForm vestForm = new com.guoan.cps.form.VestForm();
String[] aa = {"a1","a2","a3"};
String[] bb = {"b1","b2","b3"};
vestForm.setStart(aa);
vestForm.setEnd(bb);
request.setAttribute("vestForm",vestForm);
%>
<logic:iterate name="vestForm" id="vest" property="start" indexId="index">
<bean:write name="vestForm" property='<%="start["+index+"]"%>'/>
<bean:write name="vestForm" property='<%="end["+index+"]"%>'/>
<br>
</logic:iterate>
输出效果为:
a1 b1
a2 b2
a3 b3
[]作者:本站整理 来源:不祥