File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSP
Bookmark "jstl ArrayList from session" Watch "jstl ArrayList from session" New topic

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

Joined: Jul 06, 2005
Posts: 1580
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" ?

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.
I agree. Here's the link:
subject: jstl ArrayList from session
It's not a secret anymore!