Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts2 - Not able to display data in a select tag

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 .
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any help or any link that helps me on this .
 
Mamata Chaudhari
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you .i will try this and let you know.
 
Nand Prakash
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic