Results 1 to 3 of 3

Thread: ${} tags not evaluated in JstlView

Hybrid View

  1. #1

    Default ${} tags not evaluated in JstlView

    Spring 2.0.x, JDK6

    I have a JstlView served up by a Spring command controller.
    The JSP is rendered with the ${} tags unevaluated as follows:

    Count = ${count}

    The JSP src is as follows:

    Code:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head></head>
    
    <body>
      Count = ${count}
    </body>
    </html>
    I am not sure how to debug this - is there a way to trace the
    macro replacemenets in a JSP after the controller completes
    makeModelAndView()?

    Tx,

    /U

  2. #2
    Join Date
    Mar 2007
    Posts
    26

    Default

    That's not a problem with Spring but with your JSP engine, and specifically the JSP compiler/parser.
    The code generation step where it generates Java source code from your JSP doesn't recognise your JSTL 2.x syntax, assumes JSTL 1.x, and therefore doesn't generate code for the EL you used.

    Make sure you have your application set up as a Servlet 2.4 or later application in your web.xml and have the correct versions of your JSTL jars in your server (or application) classpath.

  3. #3
    Join Date
    Oct 2007
    Location
    Indianapolis, IN
    Posts
    62

    Default

    Try using the c tag.

    HTML Code:
    Count = <c:out value="${count}" />

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •