aspose file tools*
The moose likes Struts and the fly likes struts2 - Not able to  display data in a select tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 - Not able to  display data in a select tag " Watch "struts2 - Not able to  display data in a select tag " New topic
Author

struts2 - Not able to display data in a select tag

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


Hi all, am new to struts2..just learning UI Tags am struggling to get the result for populating items from my Action class .This is an example from a site .


This is inside my action classs :



I am getting this exception

Servlet failed with Exception
tag 'select', field 'list', name 'daysname': The requested list key 'day' could
not be resolved as a collection/array/map/enumeration/iterator type. Example: pe
ople or people.{name} - [unknown location]
at org.apache.struts2.components.Component.fieldError(Component.java:231
)
at org.apache.struts2.components.Component.findValue(Component.java:293)

at org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBe
an.java:79)
at org.apache.struts2.components.Select.evaluateExtraParams(Select.java:
99)
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:780)
Truncated. see log file for complete stacktrace


if anybody knows this please tell me the answer .


Save India From Corruption - Anna Hazare.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

any help or any link that helps me on this .
Mamata Chaudhari
Greenhorn

Joined: Apr 26, 2009
Posts: 23
Your code is perfectly all right.
I tested it. it's working fine.
try by giving raw type to collection as
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you .i will try this and let you know.
Nand Prakash
Greenhorn

Joined: Apr 26, 2011
Posts: 1
Ravi Kiran Va wrote:Thank you .i will try this and let you know.



Hi, I was also getting same error and tried the same but still getting error..............please help

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: struts2 - Not able to display data in a select tag