It's not a secret anymore!
The moose likes JSF and the fly likes Favicon implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Favicon implementation" Watch "Favicon implementation" New topic

Favicon implementation

jeff rusty
Ranch Hand

Joined: Nov 07, 2006
Posts: 109
Hi Rancher,

I want to implement Favicon in JSF trinidad and i couldnt find any tag that would help me to achieve this.
Incase of HTml the below code will work so i wanted to know whether is an equivalent way to achieve this in JSF
<link rel="icon" type="image/" href="">

thanks in advance
Viswanath Tg

Joined: Nov 27, 2007
Posts: 20
hi Jeff,

Check with the below snippet

<h:commandLink rel="" type="" value=""></h:commandLink>


Helping hands are better than praying lips
Rainer Eschen
Ranch Hand

Joined: Jan 24, 2009
Posts: 75
If your <link> tag works don't change it. It is valid HTML and doesn't need special treatment. Although, I'm not an active Trinidad guy I use it in ICEfaces like this. You may think about creating the icon path from the Faces Context instead.

BTW: The command link answer makes no sense because we don't talk about an action here.

ICEfaces book . ICEcube . ICEfusion . Scrum
Francisco Llaryora

Joined: Dec 30, 2011
Posts: 14
Hi, to all. I'm using Jsf with Jboss, and i have the same problem.
I try (in head tag):
<link rel="Shortcut Icon" type="image/x-icon" href="/images/favicon-sun.ico" />
but doesn't work.

Thanks !
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Don't use JSF to do what JSF doesn't do.

To make favicon work, all you really need is a bog-standard "favicon.ico" file in the usual WAR location.

If you prefer to use the "link" HTML tag, use the "f:verbatim" element to wrap (escape) the link HTML tag and place the wrapped link in the usual location for such tags in the View definition. In other words, in the HEAD section.

Do NOT use h:commandLink (which generates a JSF postback, not a "link" element). Do NOT write some excessively-complex JSF-specific Java code.

Like so many things in JSF, the simplest solution is the one that works best.

An IDE is no substitute for an Intelligent Developer.
It is sorta covered in the JavaRanch Style Guide.
subject: Favicon implementation
It's not a secret anymore!