3 Replies Latest reply: Dec 17, 2012 12:23 AM by 818962 RSS

    ExpressionFactory.createValueExpression() with JSTL function

    818962
      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"?

      Regards,
      Kenji