JSTL attempt in JSP

T

teser3

I am trying to get my first JSTL to work in Tomcat 6.0.18. I have EL
working.
I assume I have to use JSTL 1.2 for Tomcat 6.0.18?

I put the jar files (standard and jstl) in WEB-INF/lib and tried this
and do not get any JSTL output:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<title>Count to 10 Example (using JSTL)</title>
</head>

<body>
<c:forEach var="i" begin="1" end="10" step="1">
<c:eek:ut value="${i}" />

<br />
</c:forEach>
</body>
</html>


Please advise.
 
A

Arne Vajhøj

I am trying to get my first JSTL to work in Tomcat 6.0.18. I have EL
working.
I assume I have to use JSTL 1.2 for Tomcat 6.0.18?

You should.
I put the jar files (standard and jstl) in WEB-INF/lib and tried this
and do not get any JSTL output:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

Use:

<html>
<head>
<title>Count to 10 Example (using JSTL)</title>
</head>

<body>
<c:forEach var="i" begin="1" end="10" step="1">
<c:eek:ut value="${i}" />

Or just:

${i}

when using JSP 2.0.
<br />
</c:forEach>
</body>
</html>

Arne
 
J

Jean-Baptiste Nizet

Arne Vajhøj a écrit :
Or just:

${i}

when using JSP 2.0.

It doesn't make a difference in this particular example, but <c:eek:ut> is
still very useful for escaping HTML special chars.

JB.
 
T

Tom Anderson

Arne Vajh?j a ?crit :


It doesn't make a difference in this particular example, but <c:eek:ut> is
still very useful for escaping HTML special chars.

I find hiding in a comment usually works. If you're really quiet, they
don't notice you.

tom
 
A

Arne Vajhøj

Jean-Baptiste Nizet said:
Arne Vajhøj a écrit :

It doesn't make a difference in this particular example, but <c:eek:ut> is
still very useful for escaping HTML special chars.

So c:eek:ut do escape while pure EL does not?

Interesting!

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top