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包到项目)

相关文章:

  • 2021-04-24
  • 2021-11-08
  • 2021-04-02
  • 2021-06-03
  • 2022-12-23
  • 2021-08-04
  • 2021-07-25
  • 2022-12-23
猜你喜欢
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-05-20
  • 2021-09-05
  • 2021-05-23
相关资源
相似解决方案