File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL for each not working (or making a rookie mistake)

 
Kristof Smessaert
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i'm kind of new to JSTL, and i'm not at all a java expert, i have used JSTL one or two times before, i'm testing it out now, but now it's got me stumbled:

my class definitions:



my code for html generation:


The arraylist SchedulesMeulebeke gets populated, that shouldn't be the problem:
gets outputted to the browser:
434 | 437 | 440 | 443 | 446 | Hello world!

(that's what i expected, there are 5 Schedules in SchedulesMeulebeke)

However, there is no output for the JSTL for each tag? What gives? It's not iterating anything. I tried almost everything i can think of.

I can't seem to figure out the problem. Any help would be greatly appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the JSTL evaluating at all? Can you do a View Browser and still see the JSTL tags?
 
Kristof Smessaert
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

i guess you mean a View source.

HTML output:


So, no, i don't see the JSTL tags. Isn't this normal? I mean, you can't see the JSP tags either right?
 
Kristof Smessaert
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,

I have another environment (running on the same tomcat) which is correctly running JSTL tags, but as i view source there, i don't see any JSTL tags either?
English isn't my native tongue so maybe i'm missing something here?
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
 
Kristof Smessaert
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that page, it is helpfull.

However i can't seem to get the two different projects to work with JSTL expressions..

They're both running off the same tomcat server:
JSP version:
Servlet engine: 3.0
JSP engine: 2.1
Application server 7.0.22

using JSTL-1.2 jar (in both lib directory's of the projects, and in the lib directory of my tomcat)

And i've got both web.xmls starting with:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

i also include the taglibs one the pages where it is needed:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Doesn't seem to work.

I guess i'll have to work it out with regular JSP... i'm kind of on a time crunch for some of my other projects now.. :(


The specific error message is: "t h x" is a silly English abbreviation; use "thanks" instead.
--> Removing "t h x" from input is a silly way to keep other people busy..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason I asked is that if the JSTL tags still appear int he generated HTML, it means that the JSTL is not being evaluated at all. That's not the case here.

Do EL expressions work outside of the JSTL? In other words, does ${3+4} evaluate to 7?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic