Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jstl ArrayList from session

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 1640
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those might be null. null value is converted to an empty string when using JSTL.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic