Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a favicon for web app using Tomcat? [duplicate]

Tags:

Does anyone know how to implement a favicon icon for a particular application using Tomcat? This icon file would not be for all webpapps, just this one on the server in question.

like image 322
Mr Morgan Avatar asked Aug 12 '11 12:08

Mr Morgan


People also ask

What is http * * favicon ICO?

The favicon. ico file is a small graphic icon that is used by some browsers (including Microsoft Internet Explorer and Mozilla Firefox) to enhance the display of address bar information and "favorites" bookmark lists. When requesting a resource, these browsers also try to locate the site's custom favicon.

How do I make my favicon appear?

To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon. ico".

How do I change the default favicon?

If you want to change the default favicon, then you can replace the default file tomcat/webapps/ROOT/favicon. ico with your custom favicon. If you use a Jahia cluster, then you will need to do it on all of your nodes.

Why is my website favicon not showing?

When you add a favicon to your site, it may not show up since your browser has 'saved' your site as one without a favicon. You need to clear the cache in your browser or use a different browser.


2 Answers

Just add the following code in the <head> to your index.html in you webapp/projectName/

<link rel="shortcut icon"  href="http://example.com/myicon.ico" /> 
like image 130
Adnan Avatar answered Oct 10 '22 21:10

Adnan


I like to add that the original tag type for the link was "shortcut icon", but that didn't conform to the standard so it was sort of switched to "icon".

So I recomend add both to your head block:

<link rel="icon" href="http://www.example.com/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="http://www.example.com/favicon.ico" type="image/x-icon">  

Also some browsers don't support sizes other than 16px X 16px.

like image 35
belyid Avatar answered Oct 10 '22 20:10

belyid