facebook

Jstl Expressions with ${…} are Not Evaluating with Tomcat

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #256289 Reply

    treumanw
    Member

    I’m using Tomcat 5.5. Here is the relevant part of a minimal jsp. (It works just fine in RAD 6 with WebSphere 6, but not in Tomcat.)

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

    <%@ taglib uri=”http://java.sun.com/jsp/jstl/core&#8221; prefix=”c”%>

    <html>
    <body>
    This is my JSP page. <br>
    2+2:  <c:out value=”$(2+2)”></c:out>
    </body>
    </html>

    Both jstl.jar and standard.jar in WEB-INF\lib contain the following in the Manifest file:

    Specification-Version: 1.1
    Implementation-Version: 1.1.2

    In the .mymetadata file, I see the following:
    j2ee-spec=”1.4″

    But the <c:out> is displaying the string $(2+2), instead of the sum 4. WebSphere 6 is correctly displaying 4. What am I missing? Thanks very much.

    #256410 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    You might be using a Web 2.3 compliant web.xml file, which Tomcat defaults to *not* evaluating EL expressions. If you change to using a web.xml file with a proper J2EE 1.4 web 2.4 compliant file, EL processing should be enabled by default.

    #256479 Reply

    treumanw
    Member

    Here is the opening web-app tag:

    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&#8221;
    >

    I appreciate the response.

    #256543 Reply

    Riyad Kalla
    Member

    Hmm that looks right, I’m not sure why it’s not working. Maybe a tomcat configuration setting somewhere in the server.xml file? Did you try and check the Tomcat docs?

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Jstl Expressions with ${…} are Not Evaluating with Tomcat

You must be logged in to post in the forum log in