Action()方法
List list= service.queryApplySta(queryApplyStatusDto); //queryApplyStatusDto给sql传入的参数queryApplySta()方法
QueryApplyDao dao = (QueryApplyDao) context.getBean("queryApplyDao");
List<QueryApplyStatusDto> list = dao.queryApplySta(queryApplyStatusDto);
return listqueryApplySta()方法中就学了和数据库交互取值后直接return其中QueryApplyDao是实体类,例如包含 name、address、email
我要在Action()中拿到list中name的值,我该怎么遍历。
新手求教listListAction类遍历
List list= service.queryApplySta(queryApplyStatusDto); //queryApplyStatusDto给sql传入的参数queryApplySta()方法
QueryApplyDao dao = (QueryApplyDao) context.getBean("queryApplyDao");
List<QueryApplyStatusDto> list = dao.queryApplySta(queryApplyStatusDto);
return listqueryApplySta()方法中就学了和数据库交互取值后直接return其中QueryApplyDao是实体类,例如包含 name、address、email
我要在Action()中拿到list中name的值,我该怎么遍历。
新手求教listListAction类遍历
for(QueryApplyStatusDto obj : list) {
obj.getName()
}
for(int1=0;i<list.size(),i++){
dto d = (dto)list.get(i);
d.getName();
}
QueryApplyStatusDto dto = (QueryApplyStatusDto)list.get(i);
System.out.println(dto.getName());
}
QueryApplyStatusDto dto = (QueryApplyStatusDto)list.get(i);
System.out.println(dto.getName());
}