我想在进入系统首页的时候就对数据库进行查询,然后讲要查询的数据以下拉里表的形式放在页面上
Action代码如下:
private List storesInfoList = new ArrayList();
public String execute() throws Exception {
HttpServletRequest request = ServletActionContext.getRequest();
// log.info("----------UserStoresAction Action-----------");
UserStoresService userStoresService = (UserStoresService) this
.getActionService(request,
ServiceNameConstants.USER_STORES_SERVICE);
this.setStoresInfoList(userStoresService.selectUserStores());
request.setAttribute("store", storesInfoList);
return SUCCESS;
}
// -----------------getter and setter方法------------
public List<UserStoresInfo> getStoresInfoList() {
return storesInfoList;
}
public void setStoresInfoList(List<UserStoresInfo> storesInfoList) {
this.storesInfoList = storesInfoList;
}
JSP代码如下:
/s:action
可是运行就报错,提示严重: Servlet.service() for servlet jsp threw exception
tag 'select', field 'list', name 'UserStoresInfo.name': The requested list key 'storesInfoList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
哪位高手能帮我解决一下啊~~~
[b]问题补充:[/b]
我在Action把list全部替换成了iterator,结果还是提示那个错误,我感觉值没有传过去