This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access to an ArrayList from the JSP

 
Johny Harris
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiii,

I have the following problem:
I want to show the values of a database in my JSP Page. So far, here are the steps the get the values to my JSP page:

-I created a bean class, where the query to get the values from the database, is executed.
-Then I saved every row of the rows to an ArrayList in form of value objects.
Here is the coding of my bean class:



Can anyone explain me, how to access my ArrayList in the bean class from the JSP page, to iterate and show the values ?
Could anyone provide me an example?

Kind Regards,
Johny Harris
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the page controller (servlet) for the JSP, create a scoped variable in request scope for the List. For example:


Then in the JSP it is a simple matter to iterate over the List with the JSTL's <c:forEach>.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic