This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

JSTL and Collections  RSS feed

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
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?
Thanks,
[ February 06, 2003: Message edited by: Rafael Afonso ]
 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks,
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rafael,
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.

Manning.com 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.
http://www.manning.com/bayern/index.html
regards Axel
[ February 07, 2003: Message edited by: Axel Janssen ]
[ February 07, 2003: Message edited by: Axel Janssen ]
 
Author
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!