This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing a list of beans to jsp

 
Jesse Snadden
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${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.

 
Jesse Snadden
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried this and get nothing in my table



I'm missing something...
 
Jesse Snadden
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic