How to display a favicon for web app using Tomcat? [duplicate]
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.
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.
Delete or rename tomcat/webapps/ROOT/favicon.ico and Tomcat will look for a favicon.ico in the root of each web app that it serves. You don't need to put a into the head section of each page.
<link rel="shortcut icon" href="http://example.com/myicon.ico" />
add that within the <head>
of your page - where the .ico file is an icon - there are several websites (use google) that generate .ico files from pictures (gif / jpeg etc)
精彩评论