假定在Action中通过get/set了绑定了一个ModelAndView 的bean,用于渲染页面的数据。在实际的开发中,这个bean可能包含了各种页面需要的信息,因此会相当复杂。
设定:bean mv
[java]
public class CompanyMV {
private Company company;
private List
private List
private List
private List
//.......
private File logofile;
private String logofileContentType;
private String logofileFileName;
//..get/set
}
1,遍历(iterator)
1.1) 包含html
[html]
Note: 此处通过
[html]
].id.qualityindex" value="
].qualityvalue" value="
此处的id是qualitys的复合primary key. (通过hibernate生成)
固定的list
[html]
1.2) 利用tag
[php]
list="mv.floors"
listKey="locid"
listValue="shortdescription" />
1.3) 包含for循环的java代码
[html]
2,格式化(format)
2.1) 数字
[html] view plaincopy
name="mv.qualitys[
value="
/>
Note:global.format.number.nopositionif在多语言资源文件中定义,eg
[html] view plaincopy
global.format.number.noposition={0,number,##########}
global.format.number.nopositionif={0,number,##########.##}
global.format.number.2position={0,number,##########.00}
global.format.date.normal={0,date,yyyy-MM-dd}
3,集合(List,Array,Set)的显示
直接看代码,仔细阅读,不解析
[html]
].officeid" value="
].suiteid" value="
].size" value="
].cost" value="
].shortdescription" value="
].longdescription" value="
].workstation" value="
].link" value="
].rentable" onchange="java script:changeEstRent()"
>
].crate" value="
].ncrate" value="
].arate" value="
].roomtype" value="
www.2cto.com
].quality" onchange="java script:changeEstRent()">
"
].targetrent" value="