我有一個jsp和一個struts 2.0操作類。我在我的action類中設置了一個List,我將在我的jsp中使用它。struts 2.0迭代器標籤prbm
模型類是:現在
public class Student {
int stdid;
String stdName;
String stdroll;
Address stdAddress;
}
public class Address {
String houseNo;
String street;
String area;
String state;
String country;
String pin;
}
public class IteratorKFCAction extends ActionSupport{
private List<Student> studentList;
public List<Student> getStudentList() {
return studentList;
}
public void setStudentList(List<Student> studentList) {
this.studentList = studentList;
}
public String execute() {
studentList = new ArrayList<Student>();
studentList.add(std1);
studentList.add(std4);
studentList.add(std3);
studentList.add(std2);
return SUCCESS;
}
}
,在我的JSP我要顯示的每個學生的地址。 我想用特定的密碼顯示學生的地址。有人能幫我嗎。