<c:out> problem In Struts

Discussions

Web tier: servlets, JSP, Web frameworks: <c:out> problem In Struts

  1. <c:out> problem In Struts (3 messages)

    I am using Struts framework and can't seem to get JSTL core tags to work with it. For example, the JSP page

    <c:out value="${1+2+3}" />

    produces an output of ${1+2+3} instead of 6.

    I have tried this using the Jakarta struts blank application under netbeans and get the results above. If I use just a new web application from netbeans, I have no problems and the above statement works as expected. The jsp pages include:
    <%@ taglib uri="/tags/c" prefix="c" %>

    and the web.xml includes:
    <taglib>
       <taglib-uri>/tags/c</taglib-uri>
       <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
    </taglib>

    Anybody know why this is a problem?

    Threaded Messages (3)

  2. Works for me![ Go to top ]

    Using
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>c:out test</title>
    </head>
    <body>
    <c:out value="${1+2+3}"/>
    </body>
    </html>
  3. Check web.xml for web-app tag[ Go to top ]

    Check for these things:
    #1.web-app tag in web.xml should be :

    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
  4. Check web.xml for web-app tag[ Go to top ]

    Gtreat ! Thanks Ravi.. I was facing the same problem. Changing web.xml per your suggestion solved my problem.