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:
<cut 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 cut
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
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:
<cut 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 cut
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