favicon problem now that I've added call to History.newItem().

30 views
Skip to first unread message

chrisr

unread,
May 27, 2012, 6:59:45 PM5/27/12
to google-we...@googlegroups.com
Hi,

I've written an application using GWT 2.4.0 (and GXT 2.2.5) that compiles to a WAR file, runs successfully in JBoss 6.0.0-Final, and also has its own favicon.ico. However, now that I am starting to add History support I am noticing that my browser is sometimes displaying JBoss's default favicon instead of my application's. Specifically, I have (only) added a "select" listener to a TabPanel widget, and all this listener does is call History.newItem("value"). This listener is correctly adding the # fragment to the URL in the browser, but is also sometimes changing the favicon to the wrong one. The most reliable way to trigger this bug is to switch tabs and then press the browser's refresh button.

Can anyone think what might be causing this, please? I'm still thinking that this more likely to be a problem in my own code, but I've run out of ideas as to where.

The incorrect favicon has URL http://localhost:8080/favicon.ico, whereas my application's favicon is at http://localhost:8080/myapp/favicon.ico.

Thanks for any assistance,
Cheers,
Chris

Joseph Lust

unread,
May 30, 2012, 4:08:13 PM5/30/12
to google-we...@googlegroups.com
Chrisr,

Many browsers these days check for a favicon in the root directory. I found the same issue where I was setting the favicon in the HTML header, but some browsers were not getting it. You should make sure that you always have a favicon.ico and favicon.gif in your root directory, or some servers will use their own. This is also a common source for 404 errors on most servers when the assumed files are not found.


Sincerely,
Joseph
Reply all
Reply to author
Forward
0 new messages