3

I have placed favicon.ico in the web-pages directory of my project. I also placed a tag in the jsp page to put the favicon on the browser :

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

but still the favicon doesn't appear in the browser.

Why is that ? What do I need to do put the favicon in the browser.

saplingPro
  • 20,769
  • 53
  • 137
  • 195
  • are you pushing your favicon to appengine as a static resource ? – Tim Hoffman Jul 28 '12 at 08:54
  • @Tim Hoffman no.what is that? – saplingPro Jul 28 '12 at 09:52
  • images, css, js all need to be deployed via static resources in app.yaml. See https://developers.google.com/appengine/docs/java/configyaml/appconfig_yaml#Static_Files_and_Resource_Files for more details. You may not be using app.yaml but there are xml equivalents - https://developers.google.com/appengine/docs/java/config/appconfig#Static_Files_and_Resource_Files – Tim Hoffman Jul 28 '12 at 15:47

2 Answers2

2

Even if the favicon path gets resolved correctly, you might still need to clear the browser's favicon cache (happened to me once).

For example with Safari/Mac OS: Quit the browser, then delete the file $HOME/Library/Safari/WebpageIcons.db.

pipacs
  • 1,049
  • 11
  • 25
1

URLs need to be resolved as a real public web address not server side paths.

Try this:

<link href="${pageContext.request.contextPath}/favicon.ico"  rel="shortcut icon" type="image/x-icon" />

or

<link href="<c:url value="/favicon.ico"/>" rel="shortcut icon" type="image/x-icon" />
Ravi Kadaboina
  • 8,494
  • 3
  • 30
  • 42