如何使用struts2的 iterator标签迭代显示数据
List<Course> listCourse = new ArrayList<Course>();
public List<Course> getListCourse() {
return listCourse;
}
public void setListCourse(List<Course> listCourse) {
this.listCourse = listCourse;
}
public String select() throws Exception{
CourseInfoDao courseInfoDaoImpl = new CourseInfoDaoImpl();
listCourse = courseInfoDaoImpl.getCourseInfo(new Course());
Course course = null;
for(Iterator iter = listCourse.iterator();iter.hasNext();){
course = (Course)iter.next();
}
return "courseList";
}
这是我写的action代码 请问如何 用iterator 在页面显示 数据呢
[解决办法]
貌似是这样
<s:iterator value='listCourse' var='item'> <s:property value='item.XX'/></s:iterato/>
[解决办法]
<s:iterator value="#request.requirementlist" status="requeirementStatus" id="requirementlist">