File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes List of beans returning empty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "List of beans returning empty" Watch "List of beans returning empty" New topic
Author

List of beans returning empty

Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477


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


Learning and Learning!-- Java all the way!
Prasanna Soundarapandiyan
Greenhorn

Joined: Sep 04, 2009
Posts: 9
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

Joined: Jan 05, 2011
Posts: 477

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

Joined: Sep 04, 2009
Posts: 9
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

Joined: Jan 05, 2011
Posts: 477

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?
 
 
subject: List of beans returning empty
 
Similar Threads
Comparing values using JSTL
Passing a list of beans to jsp
Pagination using display tag and JSTL.Display problem
Problem with c:foreach not working
Jstl not reflecting values back to servlet