File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes jstl ArrayList from session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jstl ArrayList from session" Watch "jstl ArrayList from session" New topic
Author

jstl ArrayList from session

Alessandro Ilardo
Ranch Hand

Joined: Dec 23, 2005
Posts: 218
Hi there,
I'm trying to implement the jstl lib into my webapp.
My application is an MVC pattern which has a servlet, that stores a collection of objects in the session scope as an ArrayList.

I would like to display each object as a record in an html table row.
What's the simplest way to do it?
The examples on the web didn't help much. Would anyone be so kind to show me an example?
Thanks in advance

I've already added the jars into my tomcat 5.5.9
[ January 16, 2007: Message edited by: Alessandro Ilardo ]

trying to decode a woman mind....
Alessandro Ilardo
Ranch Hand

Joined: Dec 23, 2005
Posts: 218


The output is:


No application errors. But title and description are not displayed.
Any suggestions on how to get those properties as well?
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Given that the id is being retrieved correctly, it looks like JSTL/EL is working fine, and the issue is with your class structure, or your data.

Does your class of your "item" have methods getTitle() and getDescription() as well as getId()?

Have those values been populated? Where do you create this list in the session attribute "newsList" ?

Cheers,
evnafets
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Those might be null. null value is converted to an empty string when using JSTL.
 
Consider Paul's rocket mass heater.
 
subject: jstl ArrayList from session
 
Similar Threads
Setting a List in the request or session scope using JSTL
JSTL Help
set arraylist in jstl
JSTL and c:set
Is the following right way to access bean?