aspose file tools*
The moose likes Servlets and the fly likes Passing a list of beans to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing a list of beans to jsp" Watch "Passing a list of beans to jsp" New topic
Author

Passing a list of beans to jsp

Jesse Snadden
Greenhorn

Joined: May 16, 2011
Posts: 13
Hello,
could someone tell me what the best way is for passing a list of objects (beans) to a jsp page? It's not working for me

My servlet code



The out.println is just to prove that the information is getting passed to the servlet from my dataAccess page that talks to the server, but when I try using the request dispatcher and request.setattribute stuff, it gives me a blank page...

Here is what is happening on my jsp page I'm trying to send this list of objects to



Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30938
    
158

${grpCrt.getFolderRef} would call a method named getGetFolderRef() on grpCrt. This isn't what you want. ${grpCrt.folderRef} is better. Also, using the same name for the list and item in the list is confusing. (and I'm not sure if it works.) I recommend a different name.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jesse Snadden
Greenhorn

Joined: May 16, 2011
Posts: 13
Jeanne Boyarsky wrote:${grpCrt.getFolderRef} would call a method named getGetFolderRef() on grpCrt. This isn't what you want. ${grpCrt.folderRef} is better. Also, using the same name for the list and item in the list is confusing. (and I'm not sure if it works.) I recommend a different name.



thanks... ok this works and gives me the first line... now how do I iterate through them all?

Jesse Snadden
Greenhorn

Joined: May 16, 2011
Posts: 13
tried this and get nothing in my table



I'm missing something...
Jesse Snadden
Greenhorn

Joined: May 16, 2011
Posts: 13
ha... turns out my problem was that I didn't have the jstl jar files in my tomcat 6.0.18 lib directory... geeeeez...

Thanks for the help anyhow.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Passing a list of beans to jsp