开发者

problem with <s:select>

开发者 https://www.devze.com 2023-01-30 05:03 出处:网络
I tried run code follow the example below: http://www.mkyong.com/struts2/struts-2-sselect-drop-down-box-example/

I tried run code follow the example below:

http://www.mkyong.com/struts2/struts-2-sselect-drop-down-box-example/

but it's getting error message:

Error 500: tag 'select', field 'list', name 'yourSearchEngine': The requested list key 'searchEngine' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] 
开发者_如何学运维

How can i fix it? Thanks and regards!


Your action need either a public method called yourSearchEngine which is of type collection/array/map/enumeration/iterator. Or a private method called yourSearchEngine of the aforementioned types with a proper getter defined. Also ensure yourSearchEngine has been initialized.


This means in your view, whereever you are trying to iterate an ArrayList or any other collection, the field "list" is not getting any Collection. May be you are trying to iterate a List in <s:select>. I got this problem too. Also try cleaning your Project.

0

精彩评论

暂无评论...
验证码 换一张
取 消