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

J

javaguy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top