This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List of beans returning empty

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • 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
 
Prasanna Soundarapandiyan
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 Java Tomcat Server
  • 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 Java Tomcat Server
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic