JSTL problem, expressions not being evaluated in c:out

C

Chris

I'm just starting to use the Java Standard template library,
and I'm having a problem with my expessions being output
correctly by the c:eek:ut tag.

I've followed all of the instructions for installing JSTL,
and I am using it under Tomcat 5.0.

Here is the relevant snippet from my JSP:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %
<c:set var="browser" value="${header['User-Agent']}"/>
<c:eek:ut value="${browser}"/>

When the page is rendered, I get the output
"${browser}" instead of the evaluated expression. What am I
doing wrong?
Thanks in advance
 
C

Christophe Vanfleteren

Chris said:
I'm just starting to use the Java Standard template library,
and I'm having a problem with my expessions being output
correctly by the c:eek:ut tag.

I've followed all of the instructions for installing JSTL,
and I am using it under Tomcat 5.0.

Here is the relevant snippet from my JSP:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %
<c:set var="browser" value="${header['User-Agent']}"/>
<c:eek:ut value="${browser}"/>

When the page is rendered, I get the output
"${browser}" instead of the evaluated expression. What am I
doing wrong?
Thanks in advance

Change the <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
to <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> when
using JSP 2 (which Tomcat 5 does). Your code would be correct if you used
JSP 1.2 (Tomcat 4.X series) instead.

Also, you don't need the <c:eek:ut> anymore in JSP 2, you can just type
something like
"browser = ${browser}"
 

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


Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top