4 Replies Latest reply on Aug 25, 2009 2:35 AM by elf

    favicon

    elf

      Hi.
      I use page component and tried to set favicon for my page but I could not.
      Here is my code:

      <rich:page xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j"
       markupType="xhtml" contentType="text/html" theme="simple"
       sidebarWidth="350" sidebarPosition="right" pageTitle="TITLE">
      
       <f:facet name="pageHeader" title="advisory" >
       <link rel='stylesheet' type='text/css' href='style.css' />
       <link rel="icon" type="image/x-icon" href="images/favicon.ico"/>
       <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="images/favicon.ico"/>
       </f:facet>
      


      Please help me, what I am doing wrong ?

        • 1. Re: favicon
          ilya_shaikovsky

          JSF f:facet just not supports more than one nested child.

          • 2. Re: favicon
            elf

            I tried to do something like that:

            <f:facet name="pageHeader" title="advisory" >
             <link rel='stylesheet' type='text/css' href='style.css' />
            </f:facet>
            
            <f:facet name="pageHeader2" title="advisory2" >
             <link rel="icon" type="image/x-icon" href="images/favicon.ico"/>
            </f:facet>
            
            


            but without success.

            Please clarify, where I am wrong ?

            • 3. Re: favicon
              m.a.knapp

              Maybe the context path in the icon url is missing.
              I had the same problem, I had to prepend the context path manually

              bean code

               public String getContextPath()
               {
               return FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
               }
              


              jsf code
               <link rel="shortcut icon" type="image/x-icon" href="#{login.contextPath}/favicon.ico" />
              



              • 4. Re: favicon
                elf

                Thank you, Sir.
                It works now.