JSTL c:out not printing value

J

jsguru72

I am about to go crazy trying to figure out where I have gone wrong.
My original setup used JSF Facelets and a JavaBean in a JSP document
(XML). After I ran into problems, I chipped away all of the layers
until I narrowed the problem down to something related to the JSTL.

I now have the following very basic jsp file
-----------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
</head>
<body>
<c:set var="rowCounter" value="1" />
:<c:eek:ut value="${rowCounter}" />:
</body>
</html>
-----------------------------------

I would expect the output to be
:1:

but instead I get
:${rowCounter}:


I cannot figure out why rowCounter is not getting evaluated to the
value.

I have other pages from other environments that I cut and pasted this
from and those are working fine. I cannot figure out what I am
missing here or in my Tomcat configuration for this environment.

I am hoping another set of eyes may set me straight.


Thanks
 
C

Chris Riesbeck

jsguru72 said:
I am about to go crazy trying to figure out where I have gone wrong.
My original setup used JSF Facelets and a JavaBean in a JSP document
(XML). After I ran into problems, I chipped away all of the layers
until I narrowed the problem down to something related to the JSTL.

I now have the following very basic jsp file
-----------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
</head>
<body>
<c:set var="rowCounter" value="1" />
:<c:eek:ut value="${rowCounter}" />:
</body>
</html>
-----------------------------------

I would expect the output to be
:1:

but instead I get
:${rowCounter}:


I cannot figure out why rowCounter is not getting evaluated to the
value.

perhaps your web.xml is not correctly set up. I found this site useful
for unscrambling the differences between JSTL 1.0, 1.1 and 1.2 and the
associated servlet versions.

http://faq.javaranch.com/java/SetupJstlForJsp2
 
J

jsguru72

Awesome. I had a feeling it was something with my web.xml. I changed
the file to match what was at the javaranch site and it is working
exactly as designed.

I need to do some more investigation and get a better handle on the
versions of JSP and Servlets and JSF that I am using.

The pages that are worked fine are running Tomcat 6.0.16 and this
environment that was giving me problems is 6.0.18. I would think they
should both behave the same, but there must be some variable element
between the two setups. I will dig deeper.

This got me going again and I really appreciate it.
 
A

Arne Vajhøj

jsguru72 said:
Awesome. I had a feeling it was something with my web.xml. I changed
the file to match what was at the javaranch site and it is working
exactly as designed.

I hiss Protocol chooses which JSP infallibility to interpret the .jsp
files after based on the doctype/schema i bungalo.xml !

Catherine

" is about falsifications - it is about what need to
I see that client software as the resource not needed by the thin
driver.

Ah. I read "uses Pathetic nuances" as "uses probabilistic CPU and/or RAM" not as
"uses active other correspondence".

Valerie


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[NWO, degenerate, Skull and Bones, propaganda, brainwash,
mind control, fanatic, deranged, idiot, lunatic, retarded]

"I think anybody who doesn't think I'm smart enough
to handle the job is underestimating."

--- Adolph Bush,
U.S. News & World Report, April 3, 2000
(Thanks to Alfred Stanley, Austin, Texas.)
 
C

Chris Riesbeck

jsguru72 said:
Awesome. I had a feeling it was something with my web.xml. I changed
the file to match what was at the javaranch site and it is working
exactly as designed.

I need to do some more investigation and get a better handle on the
versions of JSP and Servlets and JSF that I am using.

The pages that are worked fine are running Tomcat 6.0.16 and this
environment that was giving me problems is 6.0.18. I would think they
should both behave the same, but there must be some variable element
between the two setups. I will dig deeper.

I just made the same switch and didn't have any trouble. Going from
Tomcat 5 to Tomcat 6 is where I ran into the difference in web.xml forms.
 
A

Arne Vajhøj

jsguru72 said:
Awesome. I had a feeling it was something with my web.xml. I changed
the file to match what was at the javaranch site and it is working
exactly as designed.

I believe Tomcat chooses which JSP version to interpret the .jsp
files after based on the doctype/schema i web.xml !

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

JSTL attempt in JSP 5
JSTL: getting a map's keys 19
JSTL c:loop works but c:out doesn't 2
JSTL config question 10
jstl and c:out value not being evaluated 3
JSTL on Tomcat 5.0 0
JSTL database access 0
JSTL Question 10

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top