• 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

problem in <s:select> usage

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to use the following code in Action class & JSP in struts2.
But I get the error message saying "tag 'select', field 'list', name 'country': The requested list key 'countryList' could not be resolved as a collection/array/map/enumeration/iterator type"

Code in Action class




code in jsp



Please let me know the reason for error & how to go about in solving the problem.

Thanks
 
Ranch Hand
Posts: 94
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
apparently you are not instantiating your action class which creates ArrayList and field variable for jsp,
for that you can make your index.jsp or your 1st page that loads on running project look like this


then in your struts.xml


and finally you need to populate your Country list
add simple populate(); line in your execute method which will populate your List or you can use Preparable interface
 
reply
    Bookmark Topic Watch Topic
  • New Topic