David Snowsill
David Snowsill

Reputation: 1537

favicon.ico in Java WAR file

Can anybody provide some instruction on how to setup a war file to show a favicon.ico in the browser address bar?

Upvotes: 23

Views: 19738

Answers (2)

stian
stian

Reputation: 2894

You can also use the following HTML markup in your HTML:

<link rel="icon" type="image/gif" href="/img/image.gif">

Most newer browsers should support it and I think it's generally a more clean way since you can use any image type/name/location you want.

Upvotes: 24

neesh
neesh

Reputation: 5265

This might be different in different application servers. For tomcat, the favicon comes from the directory your root context is mapped to. So if your application is mapped to the root context [/], just place the favicon.ico file in the top level folder in your war file.

Upvotes: 7

Related Questions