How do you remove tomcat's default favicon?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 15:01:52

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.

VinZ

To get no favicon shown, simply specify none. In most cases you must just remove the "favicon.ico" from your tomcat/webapps/ROOT. If simply removing favicon from tomcat/webapps/ROOT doesn't work for you, make sure that:

  1. Double check you really have no favicon.ico in ROOT. As default, the ROOT has a favicon.ico. So if you haven't removed it, it's still there.
  2. Check that no tag like <link rel="shortcut icon" href="http://example.com/myicon.ico" /> is in your index-site or in your called site.
  3. Favicons are cached by the browser, a simple "reload" does not reload the favion(!). So maybe your application no longer has a favicon, but your browser still shows it from the cache. Make sure that your browser cache is completely cleared. (In Google Chrome clearing "Cookies and other site data" and "Cached images and files" works for me)

In most cases, it's the browser cache... I hope this helps.

Erwald
  1. If favicon.ico is changed in Catalina Home/webapps/ROOT then all web apps will show this image URL to root-apache-tomcat-x.x.xx/webapps/ROOT.

  2. To change icon of each application specify following in head section:

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    

I was facing same issue and I have resolved it with following solution. I have added ?v=1.1.0 to the favicon line in head section of html. Whenever there is a change in favicon image I used to modify this parameter e.g. ?v=1.1.0 to ?v=1.1.1

Please see the sample code for more details.

<html>
<head>
<link rel="shortcut icon" href="favicon.ico?v=1.1.1" type="image/x-icon">
</head> 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!