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.
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.
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".
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.
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.
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" />
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With