Problem with language expression functions in Tomahawk tags

I use:

  • Tomcat 6.0
  • Jsf 1.2 - Running Mojarra
  • Tomahawk 1.1.9

I imported taglib

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 

when i call:

 <h:outputText value="#{fn:indexOf('ciao','i')}"></h:outputText> 

The output is 1

when i use

 <t:outputText value="#{fn:indexOf('ciao','i')}"></t:outputText> 

it throws a server exception, for example, there are some problems with a link to the right library.

 javax.el.ELException: Function 'fn:indexOf' not found at org.apache.el.lang.ExpressionBuilder.visit(ExpressionBuilder.java:171) at org.apache.el.parser.SimpleNode.accept(SimpleNode.java:145) at org.apache.el.lang.ExpressionBuilder.prepare(ExpressionBuilder.java:133) at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:147) 

Any hint? Thank you all for your help :)

+4
source share
1 answer

I was able to reproduce exactly this problem with Mojarra 1.2_14 and Tomahawk 1.1.9 on Tomcat 6.0.18. The same problem arose in Tomcat 6.0.20, although the line numbers of the org.apache.el.* Methods in stacktrace were slightly different.

To eliminate Tomcat's suspicion of jsp-el , I also tested Glassfish v3, which uses a different EL impl. This threw basically the same exception, albeit with different EL classes in stacktrace ( com.sun.el.* instead of org.apache.el.* ).

An interesting fact is that it really works flawlessly, using Facelets instead of JSPs, as Bojo commented. This will mean that both Tomcat and Glassfish's JSP EL implementation is broken.

I would start logging the problem for Tomcat 6 here http://tomcat.apache.org/bugreport.html and see what the Apache guys say about it.

+1
source

All Articles