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