Announcement Announcement Module
Collapse
No announcement yet.
${} tags not evaluated in JstlView Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ${} 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
    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.

    Comment


    • #3
      Try using the c tag.

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

      Comment

      Working...
      X