3 Replies Latest reply on Dec 17, 2012 6:23 AM by 818962

    ExpressionFactory.createValueExpression() with JSTL function

      Hi all,

      Code below, which is located in ManagedBean, throws javax.el.ELException: Function 'fn:length' not found.
      FacesContext fc = FacesContext.getCurrentInstance();
      ExpressionFactory ef = fc.getApplication().getExpressionFactory();
      ValueExpression valueExpression = ef.createValueExpression(fc.getELContext(), "#{fn:length('abcde')}", Integer.class);
      I put namespace difinition for "fn" (xmlns:fn="http://java.sun.com/jsp/jstl/functions") on top of jspx file.
      The EL expression "#{fn:length('abcde')}" works perfectly if I write it on jspx file.

      Can I somehow inform ExpressionFactory that the prefix "fn" is for namespace "http://java.sun.com/jsp/jstl/functions"?