2 Replies Latest reply on Feb 13, 2007 6:34 PM by Brent Fox

    Facelet TagHandler in seam.

    Brent Fox Newbie

      I've been working on developing a facelet tag to simplify my content display, and am encountering a NoClassDefFoundError: com/sun/facelets/tag/TagHandler. I have the jsf-taglib.jar within my war files /lib folder, and am using the SeamFaceletViewHandler, with no issues untill I add my custom tag.

      My tag handler class, DisplayComponentHandler extends TagHandler, compiles without issue, and deploys without error. When rendering a page, however, I get the exception.

      Here is the taglib declaration.

      <?xml version="1.0" encoding="ISO-8859-1" ?>
      
      <!DOCTYPE facelet-taglib PUBLIC
       "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
       "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
      <facelet-taglib>
       <namespace>http://www.test.com/jsf/html</namespace>
       <tag>
       <tag-name>displayContent</tag-name>
       <handler-class>com.test.ui.DisplayComponentHandler</handler-class>
       </tag>
      </facelet-taglib>
      


      and the entry within the web.xml file

       <context-param>
       <param-name>facelets.LIBRARIES</param-name>
       <param-value>/WEB-INF/tld/displaycomponent.taglib.xml</param-value>
       </context-param>
      


      Any ideas why the classloader wouldn't be able to find the class definition for the TagHandler class? Or have I missed something obvious?



        • 1. Re: Facelet TagHandler in seam.
          Pete Muir Master

          I assume you mean jsf-facelets.jar in WEB-INF/lib folder - if not that might be the problem. Otherwise you need to you need to make sure that jsf-facelets.jar is available to the classloader that is loading the tag - i.e. if jsf-facelets jar is in the war, the ComponentHandler should be as wel.

          • 2. Re: Facelet TagHandler in seam.
            Brent Fox Newbie

             

            "petemuir" wrote:
            I assume you mean jsf-facelets.jar in WEB-INF/lib folder - if not that might be the problem. Otherwise you need to you need to make sure that jsf-facelets.jar is available to the classloader that is loading the tag - i.e. if jsf-facelets jar is in the war, the ComponentHandler should be as wel.


            Sorry - yeah - I've been spending WAY too much time behind the keyboard :-)

            I have the jsf-facelets.jar within the WEB-INF/lib/, and within the WEB-INF/classes, I should have had the com/test/ui/DisplayComponentHandler.class file.

            I didn't - which led to the error above.

            Thanks for the quick post.