• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if this helps https://coderanch.com/how-to/java/ElOrJstlNotWorkingAsExpected
 
Kristof Smessaert
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic