wood burning stoves 2.0*
The moose likes Struts and the fly likes Retrieving data. Error thrown:The requested list key could not be resolved as a array type. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Retrieving data. Error thrown:The requested list key could not be resolved as a array type." Watch "Retrieving data. Error thrown:The requested list key could not be resolved as a array type." New topic
Author

Retrieving data. Error thrown:The requested list key could not be resolved as a array type.

Samuel Castillo Romero
Greenhorn

Joined: Dec 21, 2010
Posts: 26
Hi everybody,

First of all sorry for the dup. topic since I saw that issue before but I couldn't make it works on my own code so maybe anybody can help me on that.

Basically I am trying to create a form and for one of the fields I will like to put some data from the code itself (fill a dropdown list) but always I get the same error:

tag 'select', field 'list', name 'muestraCategoria': The requested list key '%{categorias}' could not be resolved as a collection/array/map/enumeration/iterator type

Let me show you my code (it is in Spanish, sorry about that)

JSP: buscaGestor.jsp



STRUTS: struts.xml


JAVA ACTIONSUPPORT




The only part which is not working is the one related to fill the drowpdown list. If I skip that one, everything is working fine... I tried to go thorugh the different issues already posted in the site but I cannot make it works.

I will really appreciate your help!

Thanks.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Samuel,

Refer This example. Name should be present in the pojo.

Its similar example which solve your problem.
Regards
Jatan
Samuel Castillo Romero
Greenhorn

Joined: Dec 21, 2010
Posts: 26
jatan bhavsar wrote:Hi Samuel,

Refer This example. Name should be present in the pojo.

Its similar example which solve your problem.
Regards
Jatan


Hi Jatan,

Really helpful your guideline! I could solve the issue. Basically I was doing two thing wrong:

1. As you said, I had to put name present in the POJO with setters/getters methods.
2. Also, I noticed about a HUGE error in my code due to I was calling to that JSP file as a HTML so there was no action executing. Now, I am executing that JSP as part of an action and it is retrieving the data properly!

Now, the next step is retrieve the data from my DataBase which shouldn't be a big deal

Thanks a lot,
Sam.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieving data. Error thrown:The requested list key could not be resolved as a array type.
 
Similar Threads
Dropdown creation dynamically from DB lookup
Dynamic forms with javascript
problem in <s:select> usage
<s:select> and fail validation
DropDown Menu error in Struts 2