• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Favicon implementation

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/vnd.microsoft.icon" href="http://example.com/image.ico">

thanks in advance
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Jeff,

Check with the below snippet

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

Regards
Viswanath
 
author
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
rubbery bacon. rubbery tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic