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 and Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL and Collections" Watch "JSTL and Collections" New topic

JSTL and Collections

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
I am starting to use the JSLT. I made a page JSP of the following form:

When I go to have access the page, do not appear nothing. Already I tried for "pageContext" before "list" and "word". However, the Tomcat returned an exception.
What must I make so that my collection appears?
[ February 06, 2003: Message edited by: Rafael Afonso ]

=================================<br /> Rafael U. C. Afonso<br /> <a href="" target="_blank" rel="nofollow"></a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
In another forum, it was suggest to me to use jsp:useBean tag. So my code became this:

Now it shows a table with rows and column... but no data! What can I do?
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
quite a while that I have not worked with jstl. Got example right.

The var="palavra"> is an assignment not an expression, I would say. If you say

I am guessing that palavra computes to null. sells a very good book about jstl for $20 as pdf.
Its written by the spec lead Shawn Bayern and it focusses pragmatically the jstl-user. I like it.
regards Axel
[ February 07, 2003: Message edited by: Axel Janssen ]
[ February 07, 2003: Message edited by: Axel Janssen ]
Shawn Bayern
Ranch Hand

Joined: May 06, 2002
Posts: 160
Thanks for the recommendation!
The issue here is between scripting variables and scoped attributes, which we call "scoped variables" in JSTL. The JSTL EL doesn't give you access to scripting variables, so if you create a variable in a scriptlet, you need to expose it either with <jsp:useBean> or with code like

<% pageContext.setAttribute("foo", foo); %>
Hope that helps!

Shawn Bayern<br />"JSTL in Action" <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: JSTL and Collections
Similar Threads
tags:panel not working in a particular situation
error while using taglib for JSTL
Using Two ArrayLists For One Table
JSTL pg 437 HFSJ
Problem iterating over implicit EL header object