The requested list key 'map' could not be resolved as a collection/array/map/enumeration/iterator ty

来源:互联网 发布:linux进程调度命令 编辑:程序博客网 时间:2024/05/16 19:16

The requested list key 'map' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or peopl

有这种提示的就是因为比如jsp代码中

<s:select list="userlist" listKey="id" listValue="firstname"></s:select>

 

userlist为空(是否为空可以通过Struts2的<debug/>标签显示的堆栈中查看,查找一下为什么为空吧。

一般情况可能是:

1、在Action类中没有给userlist变量生成get/set方法,

2、提交请求时并没有调用到对应的Action类,

3、userlist变量没有赋值成功(比如没有new、从数据库查询值的时候返回空等)

4、你的底层配置有问题(比如未导入jdbc包到项目)

0 0
原创粉丝点击