File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Favicon implementation

 
jeff rusty
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Viswanath Tg
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Jeff,

Check with the below snippet

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

Regards
Viswanath
 
Rainer Eschen
author
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Francisco Llaryora
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • 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 !
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic