Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you remove tomcat's default favicon?

Tags:

favicon

tomcat

Tomcat 6 seems to be providing a default favicon for my webapp - the tomcat logo. I don't have a favicon.ico in my webapp root, nor does my web.xml mention anything about a favicon. I even have a mapping in my web.xml for *.ico that goes to the default servlet, but it is still showing. How can I remove that tomcat favicon?

I know I can specify a favicon in several ways to override this default icon. I'm trying to find out how (if possible) to prevent the default favicon that tomcat adds and thus have no favicon.

like image 837
Keith Avatar asked May 12 '12 04:05

Keith


People also ask

What is the default favicon?

<!-- For iPad --> <link rel="apple-touch-icon" type="image/png" sizes="167x167" href="favicon-167x167.png"> <!-- For iPhone --> <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="favicon-180x180.png"> The icon file referenced by apple-touch-icon is modified to add rounded corners.

How do I turn off favicon request?

You can use . htaccess or server directives to deny access to favicon. ico, but the server will send an access denied reply to the browser and this still slows page access. You can stop the browser requesting favicon.

How do I reset my favicon cache?

How to Flush Your Favicon Cache. In some instances loading the favicon directly and refreshing it and restarting Chrome will clear the cache and show the new asset. For example — visit https://domain.tld/favicon.ico, refresh the page and restart Chrome.


3 Answers

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.

like image 200
Trevor Turton Avatar answered Oct 24 '22 05:10

Trevor Turton


  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">
    
like image 33
Erwald Avatar answered Oct 24 '22 05:10

Erwald


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.

like image 32
VinZ Avatar answered Oct 24 '22 05:10

VinZ