Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

List of beans returning empty

 
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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 love a good mentalist. And so does this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!