• 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

list empty using s:select tag with Struts 2

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need help for a s:select tag

i have an action that execute a query that return a Collection:
In the jsp page I wrote:



This is the code of my action:


Students in implemented as below:

In the list I want see the Id_student of all my students.
when I execute my application there are no errors but my list is empty?What I can do?
Please help me!!!
thank you!


 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The list element should not be within {}. Also, the S in Students has to be in lower case so Struts can call the getters and setters properly.
 
anna lanzaro
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rodrigo Bossini wrote:The list element should not be within {}. Also, the S in Students has to be in lower case so Struts can call the getters and setters properly.




if the list element is within {} I see this error

tag 'select', field 'list': The requested list key 'students' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
 
anna lanzaro
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please!!!
HELP ME!!!
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you actually try what Rodrigo said?? In the s:select tag, list="{Students}" should be list="students"...
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what you have to do is just get the value data from database put in hashmap or list and show on jsp in list attribute as mention below

JSP code:where objBussCode is my hashmap name

Edited by Dave to be legible.
 
anna lanzaro
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved my problem!!
The problem was in the query not in the select tag!
Thanks
reply
    Bookmark Topic Watch Topic
  • New Topic