You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Thomas Forrester <tf...@dbconcert.com> on 2004/03/11 13:03:12 UTC

Can't use JSTL 1.1 EL functions without errors

I am trying to use a JSTL EL function (fn:toUpperCase), although this
problem occurs with any function.
I think it has something to do with my setup.
After looking around, I realised I needed to use a Servlet 2.4 web.xml .
No I have done that I get another error.
If I use code like this:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<c:set var="initials" value="${fn:toUpperCase(param.login)}"/>

The error I get is:
org.apache.jasper.JasperException: /web/logonController.jsp(6,0)
According to TLD or attribute directive in tag file, attribute value
does not accept any expressions

I just can't seem to get a syntax that works with the functions. I am
using the other JSTL tags OK.

I am using TOMCAT 5.0.19, jakarta-taglibs-standard-1.1.0

I have setup my TLD descriptions in the web.xml as:
<jsp-config>        
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
            <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri>
            <taglib-location>/WEB-INF/tlds/x.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
            <taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
            <taglib-location>/WEB-INF/tlds/sql.tld</taglib-location>
        </taglib>
        <taglib>
 
<taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
            <taglib-location>/WEB-INF/tlds/fn.tld</taglib-location>
        </taglib>
    </jsp-config>

 

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: Can't use JSTL 1.1 EL functions without errors

Posted by Martin van Dijken <su...@windgazer.nl>.
Hey Thomas,

> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
Shouldn't this also be :
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Furthermore, Check whether in the c.tld file, at the set tag, the
rtexpr-value property is set to true. In the past the JSTL 1.1 distribution
included a c-rt.tld and a c.tld, if they are both still present, you need
the c-rt.tld for JSP 2.0/Servlet 2.4 handling of the EL-functions

Grtz,

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org