This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes JSTL for each not working (or making a rookie mistake) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL for each not working (or making a rookie mistake)" Watch "JSTL for each not working (or making a rookie mistake)" New topic
Author

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

Kristof Smessaert
Greenhorn

Joined: Nov 28, 2013
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60789
    
  65

Is the JSTL evaluating at all? Can you do a View Browser and still see the JSTL tags?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kristof Smessaert
Greenhorn

Joined: Nov 28, 2013
Posts: 4
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

Joined: Nov 28, 2013
Posts: 4
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

Joined: Jul 20, 2005
Posts: 9953
    
161

See if this helps http://www.coderanch.com/how-to/java/ElOrJstlNotWorkingAsExpected

[My Blog] [JavaRanch Journal]
Kristof Smessaert
Greenhorn

Joined: Nov 28, 2013
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60789
    
  65

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
 
subject: JSTL for each not working (or making a rookie mistake)
 
Similar Threads
Assigning jsonobject to java class having one to many relationship
JSP processing attribute in request object
Get Dates between the given dates.
Hibernate Select - Criteria with a Date
Help with printing appointments