Home > Software design >  How to provide a favicon to a Tomcat webapp which is not served on root in order to avoid browser�
How to provide a favicon to a Tomcat webapp which is not served on root in order to avoid browser�

Time:01-10

For an intranet project I have a Tomcat serving a website under http://myserver.local:1234/boilergraphs/index.html

I develop new features for this webapp in Eclipse. For debugging I am using heavily the Web Developer Tools of the external browsers Chrome and Firefox. Both browsers test automatically for Server instance context menu in the Servers View

Modules page in the Server editor, showing a second app deployed to /

CodePudding user response:

A totally different way to get rid of the 404 error cluttering your developer console, is to provide a favicon in the HTML of the page. This has the advantage that you do not need to fiddle just for the favicon with added files and routing.

Here an example(*); just add to the HTML page (say, index.html) between the <head> ... </head> tags:

<link href="data:image/x-icon;base64,AAABAAEAEBAQAAAAAAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEhEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP7/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA" rel="icon" type="image/x-icon" />

(*) Credit: favicon.cc

  •  Tags:  
  • Related