4 Replies Latest reply on Jun 8, 2007 5:38 AM by tazman

    jboss el and jstl functions issue

    tazman

      Hi all,

      I'm using jstl's fn:length() function in several places in my application. It was working with the combination of jJboss 4.0.5, ajax4jsf 1.1, faceletes 1.1.12, jsf ri 1.2, and seam 1.2.1. I started getting ClassNotFoundExceptions after I upgraded to seam cvs, ajax4jsf latest snapshot, and jboss 4.2.

      This is the exception I'm getting:

      java.lang.ClassNotFoundException: No ClassLoaders found for: com.sun.
      facelets.tag.jstl.fn.JstlFunction
       at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
      assLoader.java:514)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
      oader.java:408)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:164)
       at org.jboss.el.lang.FunctionMapperImpl$Function.getMethod(FunctionMappe
      rImpl.java:147)


      My jsf-facelets.jar is under web-inf/lib and I can use all other facelets features without any problem, so I don't understand why jstl functions cannot be loaded. Any ideas?

      tazman


        • 1. Re: jboss el and jstl functions issue
          atao

          Not all uses of jstl's fn: function produce an exception.

          For exemple:

          #{fn:length(testFromType)}
          

          works fine.

          But I get the same exception with
           <s:button id="done"
           value="Done"
           view="/TestList.xhtml"
           >
           <f:param name="lengthTest"
           value="#{fn:length(testFromType)}"/>
           </s:button>
          


          and only when I change of tab in a rich:tabPanel (but not when the page is loaded)


          • 2. Re: jboss el and jstl functions issue

            are you using ear or war packaging? if ear, try placing jsf-facelets.jar in the ear root and add a module entry into application.xml

            • 3. Re: jboss el and jstl functions issue
              atao

              Thanks! It works fine.

              • 4. Re: jboss el and jstl functions issue
                tazman

                Another solution is to use parameterized value bindings feature of the new JBoss EL. For example, the following expression returns the string length:

                #{testFromType.length()}


                You can also use other string methods like substring(). See the new "Expression language enhancements" documentation in CVS.

                I don't need to use JSTL functions anymore.

                tazman