Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up a icon for a web application in java?

I have a web application running on tomcat. I want to setup a favicon for it. Where should i place it in the tomcat web application.

like image 621
sushil bharwani Avatar asked Jul 10 '11 12:07

sushil bharwani


2 Answers

If you place a file called favicon.ico in your document root (/), it will automatically used.

like image 168
Jacco Avatar answered Sep 28 '22 23:09

Jacco


Just to summarize answers (1, 2) up:

  1. Name your icon favicon.ico and put it into the /src/main/webapp (for Maven layout) or /WebContent (for standard Eclipse layout).

  2. Specify icon in every HTML page (or master page if present):

    <head>
    <link rel="shortcut icon" href="favicon.ico"/>
    </head>

  3. Refresh project / clean/restart server / refresh page with Ctrl+F5 (to skip browser's cache).

like image 43
Nikita Bosik Avatar answered Sep 29 '22 00:09

Nikita Bosik