8 Replies Latest reply on Feb 24, 2007 5:21 AM by Ben Catherall

    custom JSF component with facelets

    David G. Newbie

      Hi, all!

      I am trying to run my JSF custom component with facelets. Is it necessary to reference de XX.taglib.xml from web.xml with this code?:


      because JBoss Seam doesn't need this context-param (Tomahawk yes). How can I avoid this parameter?. I have been looking the JBoss Seam UI source code, and seam.taglib.xml is located at META-INF.
      If I put my XX.taglib.xml there, my tag isn't executed, but rendered as plain text.

      Thanks in advance!

        • 1. Re: custom JSF component with facelets
          Pete Muir Master

          It shouldn't be, no.

          Put it in META-INF/ if you are putting the facelets in a jar included in WEB-INF/lib. Put it in WEB-INF if you are just putting the facelets straight into your war.

          BTW I never needed that parameter for tomahawk if I put the tomahawk.taglib.xml in WEB-INF (or a sub directory).

          • 2. Re: custom JSF component with facelets
            David G. Newbie

            OK, if i move the tomahawk.taglib.xml to tomahawk.jar!META-INF , it works, but with my tags this doesn't work :( any idea?

            My my.jar!META-INF content:
            taglib.tld (tags for MyFaces without facelets, for example).
            faces-config.xml (the JSF components).
            nt.taglib.xml (the link between the component-type and the component-class, the facelets)

            Thanks for your help petemuir

            • 3. Re: custom JSF component with facelets
              Pete Muir Master

              You should see log messages when you access your first facelets page

              13:20:37,850 ERROR [STDERR] 04-Dec-2006 13:20:37 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
              INFO: Added Library from: jar:file:/Z:/jboss/jboss-4.0.5.GA/server/default/./deploy/spm-seam.ear/spm-seam.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml

              for all the tag libraries facelets can load (for the entire app). If your nt.taglibrary.xml isn't mentioned please post your war structure.

              If it is then you've probably got a namespace typo between nt.taglib.xml and your facelet.

              • 4. Re: custom JSF component with facelets
                David G. Newbie

                This is the structure of the jar under my /WEB-INF/lib/:

                - faces-config.xml
                - nt.taglib.xml
                - taglib.tld
                and the packets structure containing my tags and JSF components.

                My tags work only if I specify facelets.LIBRARIES option under web.xml.


                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"

                <?xml version="1.0"?>
                <!DOCTYPE facelet-taglib PUBLIC
                 "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"

                <?xml version="1.0"?>
                <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
                 <!-- <nt:version /> -->
                 The current version of the Ntrying library.

                • 5. Re: custom JSF component with facelets
                  Pete Muir Master

                  I'm not sure then, I suggest you ask on the facelets list.


                  • 7. Re: custom JSF component with facelets
                    Frank Fischer Newbie


                    "dgallego" wrote:

                    Did you ever find a solution for this problem? I have the exact same situation.



                    • 8. Re: custom JSF component with facelets
                      Ben Catherall Newbie

                      I think you have to specify it in web.xml if you do not package your library in to its own jar file?