The original problem was most likely that you had a web.xml file in Servlet 2.4 format in a JSP 2.0 container (TC 5), but used the JSTL 1.0 EL library URIs for the taglib directives.
The main difference between JSP 1.2/JSTL 1.0 and JSP 2.0/JSTL 1.1 is that with JSP 1.2/JSTL 1.0, the tag handlers evaluate EL expressions, but with JSP 2.0/JSTL 1.1 it's the JSP container that handles the evaluation.
All attributes for the JSTL 1.0 EL libraries are marked as not
accepting expressions ("rtexprvalue" set to false): to a JSP 1.2
container they are regular strings, only recognized as expressions
by the tag handlers. The JSTL 1.0 RT libraries have all attributes
marked as accepting expressions, but in a JSP 1.2 container only
Java expressions are supported and evaluated by the JSP container.The JSTL 1.1 libraries, on the other hand, have all attributes marked as accepting expressions, and in JSP 2.0 this means that both Java and EL expressions can be used and that the container evaulates them and gives the resulting value to the tag handler.
In addition, as I've explained before, the JSP container's EL evaluation is enabled by default if you use a Servlet 2.4 web.xml file (or have no web.xml file at all), but disabled if you use a Servlet 2.3 web.xml file.
So in your case, I believe that you: * had a Servlet 2.4 web.xml file (or no web.xml) file, i.e., the container's EL evaluation feature was enabled, * used the JSTL 1.0 EL libraries, i.e., the libraries that have all attributes marked as not accepting expressions.
The best solution is to use the JSTL 1.1 libraries in a JSP 2.0 container. As Kris pointed out, you just need to change the library URIs in the taglib directives. Another solution is to use a Servlet 2.3 web.xml file (i.e., disable the container's EL evaluation) and continue to use JSTL 1.0. The latter makes sense if you have an existing JSTL 1.0 application that you want to run in a JSP 2.0 container. In either case, you can also enable or disable the EL on a per-page basis with the "isELIgnored" page directive attribute, or for a set of pages with the <el-ignored> element in a Servlet 2.4 web.xml file.
Finally (plug, plug), all of this and more is described in my JavaServer Pages book (O'Reilly).
Hope this helps, Hans
Thomas McDonald wrote:
It works now. I changed the page directive to :
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml_rt" %>
notice the '_rt' at the end
I am not sure why it works, i.e., based upon what Kris just said I shouldn't be able to run <%= %> and ="${ }" in the same tag, but I did.
Maybe is works because (I think) I am running a JSP 2.0 container--I just installed Tomcat 5.0.19 and I believe that has a JSP 2.0/Servlet 2.4 container.
Anyway, life is good :-)
This is a great mailing list. Very responsive. Thanks all.
--- Kris Schneider <[EMAIL PROTECTED]> wrote:
Until you get to JSP 2.0, you can't use scriptlet expressions and EL expressions as attribute values for the same tag. In other words, you can't use "${...}" and "<%=...%>" for attribute values in the same tag. That's why JSTL 1.0 comes with two flavors of each of its taglibs: EL-based and RT-based.
Quoting "MARU, SOHIL (SBCSI)" <[EMAIL PROTECTED]>:
Try changing the name of
url="/includes/xslt/sortablegrid.xslt" to
url="/includes/xslt/sortablegrid.xsl" The name of the file should not include .xslt but
should be .xsl
-----Original Message----- From: Thomas McDonald [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 3:09 PM To: [EMAIL PROTECTED] Subject: xslt expression
I keep getting the error "According to TLD or attribute directive in tag file, attribute xslt
does
not accept any expressions"
"doesn't accept expressions??!!" That seems absolutely crazy to me. Does it really want me to type in a whole xsl document? I have to deliver
the
xsl document via an expression. I must be doing something wrong. Any ideas?
Here is my code code:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %> <c:import url="/includes/xslt/sortablegrid.xslt" var='xslt'/> <x:transform xslt="${xslt}"> <%=objXML.getXml().toString().trim()%> </x:transform>
-- Hans Bergsten <[EMAIL PROTECTED]> Gefion Software <http://www.gefionsoftware.com/> Author of O'Reilly's "JavaServer Pages", covering JSP 2.0 and JSTL 1.1 Details at <http://TheJSPBook.com/>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
