Problem with interpolation of JSTL variables

Discussion in 'Java' started by Lord0, May 16, 2005.

  1. Lord0

    Lord0 Guest

    Hi there,

    I'm having a strange problem with JSTL and the interpolation of variables.

    Some details:
    Tomcat 5.0.28
    JSTL 1.1.2
    Eclipse 3.0.0 + Sysdeo Tomcat Plugin

    Problem: the JSTL variables within the jsp do not seem to interpolate, for
    example:

    <table>
    <tr>
    <th>Value</th>
    <th>Square</th>
    </tr>
    <c:forEach var="x" begin="0" end="10" step="2">
    <tr>
    <td><c:eek:ut value="${x}"/></td>
    <td><c:eek:ut value="${x * x}"/></td>
    </tr>
    </c:forEach>
    </table>

    Produces the following output:

    <table>
    <tr>
    <th>Value</th>
    <th>Square</th>
    </tr>
    <tr>
    <td>${x}</td>
    <td>${x * x}</td>
    </tr>
    <tr>
    <td>${x}</td>
    <td>${x * x}</td>
    </tr>
    <tr>
    <td>${x}</td>
    <td>${x * x}</td>
    </tr>
    <tr>
    <td>${x}</td>
    <td>${x * x}</td>
    </tr>
    <tr>
    <td>${x}</td>
    <td>${x * x}</td>
    </tr>
    </table>

    So the iterator appears to work, in some fashion, however the variables are
    not interpolated.

    At the top of my .jsp file I include the following line:

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

    And I have copied the files jstl.jar and standard.jar to the /WEB-INF/lib
    folder of the web-app as per the docs.

    Any ideas?

    Cheers

    Lord0
     
    Lord0, May 16, 2005
    #1
    1. Advertising

  2. Lord0

    Lord0 Guest

    found the solution to my problem:

    Added

    <%@ page isELIgnored="false"%>

    to top of .jsp

    Sorry for the timewaste
     
    Lord0, May 16, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Rasmussen

    Access variables in JSTL tag

    Jon Rasmussen, Jul 8, 2004, in forum: Java
    Replies:
    2
    Views:
    1,011
    Roman Seibold
    Jul 9, 2004
  2. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    1,000
    Robert Mark Bram
    Dec 15, 2004
  3. DaFoot
    Replies:
    1
    Views:
    1,732
    DaFoot
    Oct 23, 2008
  4. Dietrich
    Replies:
    3
    Views:
    162
    Joe Smith
    Jul 25, 2004
  5. kw
    Replies:
    2
    Views:
    106
    Brian McCauley
    Nov 17, 2005
Loading...

Share This Page