Struts, JSTL "ELException: Unable to find a value for..."

Discussion in 'Java' started by javaguy@sbcglobal.net, Feb 9, 2006.

  1. Guest

    I have a JSP/Struts site that currently works. I code it with a regular
    text editor. I compile it through an ant script. The site has a web.xml
    that begins like:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>

    I want to be able to create a standard web project in Eclipse or
    NetBeans, compile it through the IDE facilities (including compiling
    the JSP files) and run/debug it through the IDE. My attempt is failing
    because of some JSTL versioning problems.

    The IDEs want my web.xml to begin with:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 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">

    I have a web page with this include:

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

    and I use constructs:

    <c:eek:ut value="${myform.myfield}"/>
    <c:forEach items="${myform.mylist}" var="listitems" ...>
    ...
    <c:choose>
    <c:when test="${listitems.somestatus eq 'OPEN'}">
    ....

    When I just change the web.xml file to the "version 2.4" style the
    compiler complains that my JSP page can't be compiled because the c:eek:ut
    value construct won't accept a EL expression. So I change to a
    different c.tld, changing around the taglib for that and end up with
    the error "ELException: Unable to find a value for "somestatus" in
    object of class "java.lang.String" using operator "."

    (Actually, I've simplified my problem-creating sequence a bit, but this
    is the flavor...).

    I've seen a bit of advice to do this and that, without real coherence
    in the advice or results. I *do* know that the version that works
    compiles the JSP file into a Java file with this construct:

    _jspx_th_c_when_1.setTest("${listitems.somestatus eq 'OPEN'}");

    whereas the configurations that *do not* work compile the JSP file into
    a Java file with this construct:
    _jspx_th_c_when_1.setTest(
    ((java.lang.Boolean)
    org.apache.jasper.runtime.PageContextImpl.
    proprietaryEvaluate("${listitems.somestatus eq 'OPEN'}",
    java.lang.Boolean.class,
    (PageContext)_jspx_page_context,
    null, false)).booleanValue());

    yields the ELException result.

    I believe that I am mixing several versions of TLD, web.xml
    architectures and jar files. Can I get instructions on what jars to
    put where, which TLDs to have, and to have defined in my web.xml file
    and JSP pages?

    Thanks in advance,

    Jerome Mrozak
     
    , Feb 9, 2006
    #1
    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. Jack

    JSTL with Struts c:forEach

    Jack, Aug 5, 2003, in forum: Java
    Replies:
    2
    Views:
    16,439
    VisionSet
    Aug 5, 2003
  2. TPM

    Struts & JSTL <c:out>

    TPM, Oct 23, 2003, in forum: Java
    Replies:
    1
    Views:
    4,193
    VisionSet
    Oct 23, 2003
  3. Tony Piazza
    Replies:
    0
    Views:
    870
    Tony Piazza
    Feb 20, 2004
  4. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    977
    Robert Mark Bram
    Dec 15, 2004
  5. DaFoot
    Replies:
    1
    Views:
    1,705
    DaFoot
    Oct 23, 2008
Loading...

Share This Page