• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to display arraylist value in jsp, using JSTL tags?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an arraylist object(e,g myArrayList),which contains a bean object.
Now if i m setting this object in request using:

request.setAttribute("myArraylist",myArrayList);

i want this object in my jsp. I know how to iterate the values using scriptlets, but i want to use jstl tags to retrieve the value of the Arraylist from the request object. N use the tags to display the values in jsp.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.crazysquirrel.com/computing/java/jsp/jstl-forEach.jspx

Or most anything else turned up by searching for c:forEach tag.
 
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use forEach core jstl tag.


It's like Java foreach:
 
Pradeep Prabhakaran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



Here, shouldn't i specify the type of the "var" in <c:forEach> tag.Will just the name of the bean object be sufficient.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please see the JavaRanch naming policy and change your display name to conform with this policy. Thanks!

You do not need to set the type. (I'm not even sure you can.) Wouldn't it just be easier to try it rather than wait for an answer?
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Logan Wolverine wrote:
Here, shouldn't i specify the type of the "var" in <c:forEach> tag.Will just the name of the bean object be sufficient.


I couldn't understand you wordings. Check this documentation.
 
reply
    Bookmark Topic Watch Topic
  • New Topic