• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic