• 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 of beans returning empty

 
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi all,
Im trying to fetch a list of beans from my servlet ,im being able to print this list in the servlet ,.Im using jstl tags to rpint the list in the jsp.However when i try fetching the same list of beans in my jsp , it returns a null.ie. the list is shown as empty .Any idea as to where i could be going wrong?
This is my jsp code fragment.

my server side code
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could you please provide the jsp form tag code? and also the have you checked whether you are adding the list to your action form? Provide the information what is the dao that you used in your code.

if possible place your jsp and servlet
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont understand what you mean by action form?
Im using a set of beans ,jsp and a servlet controlling class.
The Link to my jsp is below..
http://pastebin.com/embed_iframe.php?i=4L56dsAe
And my relevant servlet code is below.
.
Thank you for replying.


 
Prasanna Soundarapandiyan
Greenhorn
Posts: 9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the doPost() , you have added the domList directly to the request, but while reading in jsp, it has been trying to read from dao.domList, Please try readin the domList directly inside the c:forEach.

<c:forEach var="dl" items="${domList}">
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prasanna,
Thank you for replying . That worked!
However, a doubt, I use dao.dtList in order to generate a dropdown , i dont set it in the request either ,it works , then why doesnt the same apply here?
 
I've been selected to go to the moon! All thanks to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic