aspose file tools
The moose likes JSP and the fly likes How to display arraylist value in jsp, using JSTL tags? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "How to display arraylist value in jsp, using JSTL tags?" Watch "How to display arraylist value in jsp, using JSTL tags?" New topic
Author

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

Pradeep Prabhakaran
Greenhorn

Joined: Sep 25, 2010
Posts: 7
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.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

http://www.crazysquirrel.com/computing/java/jsp/jstl-forEach.jspx

Or most anything else turned up by searching for c:forEach tag.
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

You can use forEach core jstl tag.


It's like Java foreach:


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Pradeep Prabhakaran
Greenhorn

Joined: Sep 25, 2010
Posts: 7



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
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Nov 04, 2009
Posts: 2066

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to display arraylist value in jsp, using JSTL tags?
 
Similar Threads
Replace scriptlet on JSP
JSTL c:forEach help?
How to convert Java ArrayList code to JSTL
display a arraylist value in JSP using JSTL
Collection on jsp