aspose file tools*
The moose likes Struts and the fly likes problem in <s:select> usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in <s:select> usage" Watch "problem in <s:select> usage" New topic
Author

problem in <s:select> usage

Vidya Lakshman
Greenhorn

Joined: Apr 09, 2008
Posts: 11
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
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

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


Learning some thing New Every Day
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in <s:select> usage
 
Similar Threads
tag 'select', field 'list', name 'courseName': The requested list key 'Course' could not be resolved
jsp
Struts 2 checkboxlist error - list key could not be resolved
JspException: Failed to obtain specified collection for Struts:optionscollection
How to display a list box with values from an "Array List" in "Struts2"