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


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM